威尼斯手机平台登陆-官方网站登录

威尼斯手机平台登陆为您带来世界三大博彩公司最新相关资讯,威尼斯官方网站登录充分考虑到不同地域网民的不同需求,威尼斯手机平台登陆良好的用户界面,人性化的操作,实用的功能设计使其广泛受到欢迎,推动实体出版、影视、动漫、游戏等相关文化产业的发展。

您的位置:威尼斯手机平台登陆 > 威尼斯在线注册平台 > 付费投稿计划,1.HTML5+CSS3实现的模拟真人奔跑动画特效

付费投稿计划,1.HTML5+CSS3实现的模拟真人奔跑动画特效

发布时间:2020-03-12 13:41编辑:威尼斯在线注册平台浏览(160)

    本文由码农网 – 小峰原创,转发请看清文末的转发供给,应接参加大家的付费投稿布署!

    本文由码农网 – 小峰原创,转发请看清文末的转发必要,迎接参加我们的付费投稿陈设!

    2016 HTML5/CSS3销路好动画特效TOP10,

    1.HTML5+CSS3兑现的模拟真人奔跑动画特效

    明日要享受一款太酷的模仿真人奔跑动漫,它根本是行使HTML5/CSS3技能结合多张图纸的切换成达成的。那款HTML5动漫的呼之欲出之处在于人物在跑步的时候很有节奏感,並且有职员的黑影。更器重的是当人物跑的尤其近是,人物的大小也会随之变大。很像一个男小孩子从外国跑过来。

    图片 1

    在线演示

    源码下载

    2.jQuery兑现的四款扶助分裂自定义图片切换的关节图插件特效

    jQuery实现的四款帮忙不一样自定义图片切换的刀口图插件特效源码L_slide.js,是一段能够实现自定义图片切换的转捩点图动漫特效代码,本段代码中饱含四款难点图切换效果。

    图片 2

    在线演示

    源码下载

    3.HTML5兑现的超酷笔刷画图动漫特效

    明日我们要分享一款超酷的HTML5笔刷动漫,我们能够选拔分化的笔刷形状,共有5种不一致的模样可供我们接纳,笔刷在画布上活动时就能播放非常灿烂的卡通片效果。且动漫的颜料还有大概会随即间渐变。

    图片 3

    在线演示

    源码下载

    4.JS实现的原生态难点图轮播带左右开关动漫

    JS完成的原生态问题图轮播带左右按钮动漫特效源码,是一段极度相符在大肆网站网页中采用的标准图轮播代码,该代码由原生态JS组成,不独有饱含左右点击按键,同一时候在图片中下方还足以点击圆点选用看来图片。

    图片 4

    在线演示

    源码下载

    5.jquery落实的相册列表鼠标滑过翻牌呈现文字动漫

    jquery完毕的相册列表鼠标滑过翻牌显示文字动漫特效源码,是一段能够完结鼠标滑过悬停时图片时,图片翻牌动漫显示文字的特效代码。

    图片 5

    在线演示

    源码下载

    6.div+css完成相册列表鼠标经过下方弹出文字表明动态

    div+css达成相册列表鼠标经过下方弹出文字表明动态特效源码,是一段借助纯DIV+CSS完成的代码,本款代码达成了,鼠标悬停图片时,图片缩短并在图片下方弹出有关文字表明。

    图片 6

    在线演示

    源码下载

    7.jquery落成的通栏全屏带缩略图和左右箭头切换的核心图

    jquery实现的通栏全屏带缩略图和左右箭头切换的纽带图特效源码,是一款能够兑现全屏横向带缩略图及左右箭头切换效能的症结图代码,必要此段代码的爱大家方可前来下载应用。

    图片 7

    在线演示

    源码下载

    8.HTML5 Canvas绘制一级可爱灰太狼图形效果

    HTML5 Canvas也便是一个画板,你能够在Canvas绘制狂妄的事物,后天要享受一款应用HTML5 Canvas绘制的灰太狼形象,个人以为,那么些灰太狼绘制得至极活脱脱形象,小伙伴们都要傻眼了。未来大家再来弄二个HTML5 Canvas的欢欣怎样?

    图片 8

    在线演示

    源码下载

    9.CSS3贯彻的3D侧躺菜单特效

    前天我们来分享一款CSS3落到实处的3D菜单特效,那款3D菜单的天性是它侧躺在页面上,张开子菜单时也可以有优异的卡通,何况子菜单也表现3D的机能,我们可以下载那款菜单的源码学习斟酌。

    图片 9

    在线演示

    源码下载

    10.Animate.css拥有多款文字特效的css3动画库

    Animate.css具有多款文字特效的css3动漫库效果源码,是一段具有数十款文字特效的css3动漫库代码,在此边大家得以对文字举办精选要加载的动画片特效。

    图片 10

    在线演示

    源码下载

    HTML5/CSS3紧俏动漫特效TOP10, 1.HTML5+CSS3兑现的效仿真人奔跑动漫特效 今天要享受一款非常的帅的比葫芦画瓢真人奔跑动漫,它重要是应用HTML5/CSS3技...

    那是一款基于HTML5的难点图动漫,它和其余关键图不一样的地点在于,它播放的不止是图表,而是能够自定义调节的网页元素。它不但在图纸间切换有联网动漫效果,并且在切换时图片中的成分也将现身动漫效果,比如图中的文字移动、打垮、重新整合等。那款HTML5动漫图片播放器算得上是高级大气上档案的次序。

    那是一款基于HTML5和jQuery的3D大旨图动漫,大旨图中的图片采纳了CSS3的相干个性达成图片偏斜效果,进而让图片现身3D的视觉效果。那款HTML5规范图既能手动点击开关切换图片,並且还扶植自动切换图片,使用起来也相当便利。假诺您需求在网站中展现产物图片,那么那款主旨图插件特别符合你。

    图片 11

    图片 12

    在线演示源码下载

    在线演示源码下载

    HTML代码

    <div class="parallax-bg" id="slider-wrap">
        <div class="slider parallax-bg" id="slider">
               <div class="slider-sections sandbox"> 
            <section class="first">
                         <img alt="Kendo UI" src="images/home-banner-1.png"/>
                         <div class="text">
                              <h2>SmartSite Ver 2.2<br />智能网站管理系统 </h2>
                              <p class="copy">采用前后台完全分离技术,通过标签(支持标签循环嵌套、判断标签、自定义标签、文件循环嵌套等)加模板技术.全站生成纯静态页。</p>
                              <p class="button"><a href="#" onclick="_gaq.push(['_trackPageview', '#']);">Download</a> <a class="dimmed" onclick="_gaq.push(['_trackPageview', '#']);" href="#">Learn More</a></p>
                         </div>
                    </section>
            <section>
                         <img src="images/dataviz-home-image-q2.png" alt="Kendo UI" />
                         <div class="text" style="padding-top: 10px;">
                              <h2>企业网站管理系统</h2>
                              <p class="copy">单页面、单页面索引、新闻、产品展示、下载、友情链接、网上商城,在线支付、配送、支付方式管理、广告等模块。</p>
                              <p class="button"><a href="#" onclick="_gaq.push(['_trackPageview', '#']);">Download</a> <a class="dimmed" onclick="_gaq.push(['_trackPageview', '#']);" href="#">Learn More</a></p>
                         </div>
                    </section>
            <section>
                         <img src="images/home_banner_web-q2.png" alt="Kendo UI" />
                         <div class="text">
                              <h2>智能移动网站管理系统</h2>
                              <p class="copy">基于jquery.Mobile、HTML5技术框架,前后台完全分离,采用标签加模板技术,全站生成纯静态页。</p>
                              <p class="button"><a href="#" onclick="_gaq.push(['_trackPageview', '#']);">Download</a> <a class="dimmed" onclick="_gaq.push(['_trackPageview', '#']);" href="#">Learn More</a></p>
                         </div>
                    </section>
               </div>
          </div>
          <a class="slider-prev" href="javascript: void(0)">?</a> <a class="slider-next" href="javascript: void(0)">?</a>
    </div>
    

    HTML代码

    <section id="dg-container" class="dg-container">
        <div class="dg-wrapper">
            <a href="#"><img src="images/1.jpg" alt="image01"><div>http://www.colazionedamichy.it/</div></a>
            <a href="#"><img src="images/2.jpg" alt="image02"><div>http://www.percivalclo.com/</div></a>
            <a href="#"><img src="images/3.jpg" alt="image03"><div>http://www.wanda.net/fr</div></a>
            <a href="#"><img src="images/4.jpg" alt="image04"><div>http://lifeingreenville.com/</div></a>
            <a href="#"><img src="images/5.jpg" alt="image05"><div>http://circlemeetups.com/</div></a>
            <a href="#"><img src="images/6.jpg" alt="image06"><div>http://www.castirondesign.com/</div></a>
            <a href="#"><img src="images/7.jpg" alt="image07"><div>http://www.foundrycollective.com/</div></a>
            <a href="#"><img src="images/8.jpg" alt="image08"><div>http://www.mathiassterner.com/home</div></a>
            <a href="#"><img src="images/9.jpg" alt="image09"><div>http://learnlakenona.com/</div></a>
            <a href="#"><img src="images/10.jpg" alt="image10"><div>http://www.neighborhood-studio.com/</div></a>
            <a href="#"><img src="images/11.jpg" alt="image11"><div>http://www.beckindesign.com/</div></a>
            <a href="#"><img src="images/12.jpg" alt="image12"><div>http://kicksend.com/</div></a>
        </div>
        <nav> 
            &lt;
            &gt;
        </nav>
    </section>
    

    CSS代码:

    此间列出的是其一骨节眼图相关的骨干CSS代码。

    .slider section {display: none;}
    .slider section.first {display: block;}
    
    .slider-sections, .slider-sections section {width: 861px; height: 335px;}
    
    .slider-sections {margin: 0 auto; position: relative;}
    .slider-sections section {position: absolute; top: 0; left: 0px; }
    
    .header-content h2 
    {
        font:400 32px/1.2 "microsoft yahei", Tahoma, arial, sans-serif;
        color: #fff;
        margin: 0 0 26px;
    }
    .header-content p 
    {
        margin: 0 0 30px;
    }
    
    .header-content .centered-content
    {
        padding-top: 30px;
        padding-bottom: 10px;
    }
    
    .button {
        float: left;
        width: auto !important;
        list-style: none;
    }
        .button a,
        .button button,
        .button input { /* Standard black button */
          font-size: 15px;
          /*font-family: 'lucida sans',arial,helvetica,sans-serif;*/
          line-height: 18px;
            color: #fff !important;
    
          text-decoration: none;
    
          padding: 5px 14px 6px 13px;
            display: block;
            width: auto;
            position: relative;
            z-index: 2;
    
            border: none;
            -moz-border-radius: 3px;
            border-radius: 3px;
            cursor: pointer;
    
            background: #313131; /* Old browsers */
            background: -moz-linear-gradient(top, #313131 0%, #222222 100%); /* FF3.6+ */
            background: -webkit-linear-gradient(top, #313131 0%,#222222 100%); /* Chrome10+,Safari5.1+ */
            background: -o-linear-gradient(top, #313131 0%,#222222 100%); /* Opera11.10+ */
            background: -ms-linear-gradient(top, #313131 0%,#222222 100%); /* IE10+ */
            background: linear-gradient(top, #313131 0%,#222222 100%); /* W3C */
    
            -webkit-transition: all 0.3s ease;
            -moz-transition: all 0.3s ease;
            -o-transition: all 0.3s ease;
            transition: all  0.3s ease;
        }
    
        .button a:hover,
        .button input:hover,
        .button button:hover,
        .button a:focus,
        .button input:focus,
        .button button:focus
        {
          background: #464646; /* Old browsers */
            background: -moz-linear-gradient(top, #464646 0%, #393939 100%); /* FF3.6+ */
            background: -webkit-linear-gradient(top, #464646 0%,#393939 100%); /* Chrome10+,Safari5.1+ */
            background: -o-linear-gradient(top, #464646 0%,#393939 100%); /* Opera11.10+ */
            background: -ms-linear-gradient(top, #464646 0%,#393939 100%); /* IE10+ */
            background: linear-gradient(top, #464646 0%,#393939 100%); /* W3C */
        }
    
        header .header-content .button a,
        #content .button a:hover
        {
            text-decoration: none;
        }
    
    .header-content .beta-ribbons {
        position: absolute; 
        height: 120px;
        width: 85px;
        text-indent: -200px;
        overflow: hidden;
        background: url(../images/kendo-ribbons.png) no-repeat 0 0;
    }
    
    .header-content .beta-ribbons.ribbon-1 {
        background-position: -170px 0;
        top: -3px;
        right: -145px;
    }
    
    .header-content p.copy .beta-ribbons.ribbon-1 {
        top: -135px;
        left: 900px;
    }
    
    .header-content .beta-ribbons.ribbon-4 {
        background-position: -255px 0;
        left: -62px;
        top: -30px;
        z-index: 10;
            text-indent: -2000px;
    }
    

    CSS代码

    .dg-container{
        width: 100%;
        height: 450px;
        position: relative;
    }
    .dg-wrapper{
        width: 481px;
        height: 316px;
        margin: 0 auto;
        position: relative;
        -webkit-transform-style: preserve-3d;
        -moz-transform-style: preserve-3d;
        -o-transform-style: preserve-3d;
        -ms-transform-style: preserve-3d;
        transform-style: preserve-3d;
        -webkit-perspective: 1000px;
        -moz-perspective: 1000px;
        -o-perspective: 1000px;
        -ms-perspective: 1000px;
        perspective: 1000px;
    }
    .dg-wrapper a{
        width: 482px;
        height: 316px;
        display: block;
        position: absolute;
        left: 0;
        top: 0;
        background: transparent url(../images/browser.png) no-repeat top left;
        box-shadow: 0px 10px 20px rgba(0,0,0,0.3);
    }
    .dg-wrapper a.dg-transition{
        -webkit-transition: all 0.5s ease-in-out;
        -moz-transition: all 0.5s ease-in-out;
        -o-transition: all 0.5s ease-in-out;
        -ms-transition: all 0.5s ease-in-out;
        transition: all 0.5s ease-in-out;
    }
    .dg-wrapper a img{
        display: block;
        padding: 41px 0px 0px 1px;
    }
    .dg-wrapper a div{
        font-style: italic;
        text-align: center;
        line-height: 50px;
        text-shadow: 1px 1px 1px rgba(255,255,255,0.5);
        color: #333;
        font-size: 16px;
        width: 100%;
        bottom: -55px;
        display: none;
        position: absolute;
    }
    .dg-wrapper a.dg-center div{
        display: block;
    }
    .dg-container nav{
        width: 58px;
        position: absolute;
        z-index: 1000;
        bottom: 40px;
        left: 50%;
        margin-left: -29px;
    }
    .dg-container nav span{
        text-indent: -9000px;
        float: left;
        cursor:pointer;
        width: 24px;
        height: 25px;
        opacity: 0.8;
        background: transparent url(../images/arrows.png) no-repeat top left;
    }
    .dg-container nav span:hover{
        opacity: 1;
    }
    .dg-container nav span.dg-next{
        background-position: top right;
        margin-left: 10px;
    }
    

    JavaScript代码:

    上面是这些转折点图插件的代码。

    /**
    * @author Alexander Farkas
    * v. 1.22
    */
    (function ($)
    {
        if (!document.defaultView || !document.defaultView.getComputedStyle)
        { // IE6-IE8
            var oldCurCSS = $.curCSS;
            $.curCSS = function (elem, name, force)
            {
                if (name === 'background-position')
                {
                    name = 'backgroundPosition';
                }
                if (name !== 'backgroundPosition' || !elem.currentStyle || elem.currentStyle[name])
                {
                    return oldCurCSS.apply(this, arguments);
                }
                var style = elem.style;
                if (!force && style && style[name])
                {
                    return style[name];
                }
                return oldCurCSS(elem, 'backgroundPositionX', force) + ' ' + oldCurCSS(elem, 'backgroundPositionY', force);
            };
        }
    
        var oldAnim = $.fn.animate;
        $.fn.animate = function (prop)
        {
            if ('background-position' in prop)
            {
                prop.backgroundPosition = prop['background-position'];
                delete prop['background-position'];
            }
            if ('backgroundPosition' in prop)
            {
                prop.backgroundPosition = '(' + prop.backgroundPosition;
            }
            return oldAnim.apply(this, arguments);
        };
    
        function toArray(strg)
        {
            strg = strg.replace(/left|top/g, '0px');
            strg = strg.replace(/right|bottom/g, '100%');
            strg = strg.replace(/([0-9.]+)(s|)|$)/g, "$1px$2");
            var res = strg.match(/(-?[0-9.]+)(px|%|em|pt)s(-?[0-9.]+)(px|%|em|pt)/);
            return [parseFloat(res[1], 10), res[2], parseFloat(res[3], 10), res[3]];
        }
    
        $.fx.step.backgroundPosition = function (fx)
        {
            if (!fx.bgPosReady)
            {
                var start = $.curCSS(fx.elem, 'backgroundPosition');
                if (!start)
                {//FF2 no inline-style fallback
                    start = '0px 0px';
                }
    
                start = toArray(start);
                fx.start = [start[0], start[2]];
                var end = toArray(fx.end);
                fx.end = [end[0], end[2]];
    
                fx.unit = [end[1], end[3]];
                fx.bgPosReady = true;
            }
            //return;
            var nowPosX = [];
            nowPosX[0] = ((fx.end[0] - fx.start[0]) * fx.pos) + fx.start[0] + fx.unit[0];
            nowPosX[1] = ((fx.end[1] - fx.start[1]) * fx.pos) + fx.start[1] + fx.unit[1];
            fx.elem.style.backgroundPosition = nowPosX[0] + ' ' + nowPosX[1];
    
        };
    })(jQuery);
    
    /*
    tlrkSlider
    
      example usage:
    
        $("#slider").tlrkSlider({
          autoStart: false,
          elements: {
            "img": {delay: 10},
            "h2": {delay: 500},
            ".copy": {delay: 800},
            ".button": {delay: 1000}
          }
        });
    
      to go to a specific frame:
        $("#slider").tlrkSlider("go", position);
        "position" can have one of the following values:
        "next", "prev", "first", "last", "+1", "-1" or a numeric value
    
      to start/stop the automatic loop:
        $("#slider").tlrkSlider("start");
        $("#slider").tlrkSlider("stop");
    
      to change the delay between automatic transitions:
        $("#slider").tlrkSlider("option", "delayAnimation", 1000);
    
      to change any option:
        $("#slider").tlrkSlider("option", option_name, option_value);
    
      Changing the "elements" object is not tested.
    
      Changing the following options: "navigation", "navigationClass", "framesSelector", "autoStart" won't have any effect for now.
      They are used only during the initialization.
    
      $("#slider").data("tlrkSlider") will return the plugin instance and the methods/properties can be accessed from there.
    
      The plugin contructor defaults are accessable through TlrkSlider.defaults
    
      The function that actually sweep the elements in/out can be overriden from
        TlrkSlider.prototype._animationIn and TlrkSlider.prototype._animationOut
    
        See sweepIn/sweepOut 
    
     */
    
    ;(function( $, window, document, undefined ){
    
      // utility function that generates the "dots" navigation
      function generateNavigation($el, count, config) {
        var i, html = "",
            width = count * 24;
    
        html += "<ol class='" + config.navigationClass + "' style='margin-left: -" + width/2 + "px; width: " + width + "px'>";
        for (i = 0; i < count; i++) {
          html += "<li><a " + (i === 0 ? "class='selected'" : "" ) + " href='#" + (i) + "'>slide</a></li>";
        }
        html += "</ol>";
    
        $el.append(html);
      }
    
      function sweepOut($el, windowWidth) {
        var dfr = $.Deferred(),
            pos = $el.position(),
            width = $el.width(),
            delta, final,
            options = $el.data("tlrkAnimOptions");
    
        windowWidth = windowWidth || $(window).width(); // check if the windowWidth is passed, if not - get it
    
        delta = windowWidth - pos.left;
        final = -(delta);
    
        setTimeout(function(){
          $el.animate({left: final, opacity: "toggle"}, options.speed, options.easing, function(){
            dfr.resolve();
          });
        }, options.delay);
    
        return dfr.promise();
      }
    
      function sweepIn($el, windowWidth, frameLeft) {
        var dfr = $.Deferred(),
            options = $el.data("tlrkAnimOptions"),
            positionData = $el.data("tlrkOriginalPos"),
            final = positionData.position.left,
            rightEdge;
    
        windowWidth = windowWidth || $(window).width(); // check if the windowWidth is passed, if not - get it
    
        $el.css({opacity: 0, display: "block"}); // move it outside the right edge of the screen
        $el.css("left", function(current){
          return current + windowWidth - frameLeft;
        });
    
        setTimeout(function(){
          $el.animate({left: final, opacity: 1}, options.speed, options.easing, function(){
            dfr.resolve();
          });
        }, options.delay);
    
        return dfr.promise();
      }
    
      // two pass function that first iterates all the elements and gets their position/width/height
      // and then sets their position to absolute
      function absolutize($elements) {
    
        // todo - move it to separate function and do it just once
        // gather the original position/dimension data for all elements
        $elements.each(function(){
          var $t = $(this);
    
          if ($t.data("tlrkOriginalPos")) return
    
          $t.data("tlrkOriginalPos", {
            position: $t.position(),
            width: $t.width(),
            height: $t.height(),
            css_pos: $t.css("position"),
            css_left: $t.css("left"),
            css_top: $t.css("top"),
            css_width: $t.css("width") || "auto",
            css_height: $t.css("height") || "auto"
          });
    
        });
    
        // set the absolute position
        $elements.each(function(){
          var $t = $(this),
              opos = $t.data("tlrkOriginalPos");
    
          $t.css({
            position: "absolute",
            left: opos.position.left,
            top: opos.position.top,
            width: opos.width,
            height: opos.height
          });
        });
      }
    
      function restoreFrameElements($elements) {
        $elements.each(function(){
          var $t = $(this),
              opos = $t.data("tlrkOriginalPos");
    
          if (!opos) return
    
          $t.css({
            position: opos.css_pos,
            left: opos.css_left,
            top: opos.css_top,
            width: opos.css_width,
            height: opos.css_height
          });
        });
    
      }
    
      var TlrkSlider = function( elem, options ){
          this.elem = elem;
          this.$elem = $(elem);
          this.options = options;
        };
    
      // the plugin prototype
      TlrkSlider.prototype = {
        defaults: {
    
          defaultElementOptions: {
            speed: 1200,
            easing: "easeInOutBack",
            // interval before the element starts moving when the fadeIn/Out functions are called
            // it's a good idea to give different delays for the different elements
            // if all have the same delay they'll start moving all together
            delay: 100 
          },
    
          // dispose elements are these that are not included in the elements object
          // but affect the document flow and will be fadedIn/Out
          disposeDelay: 100, // delay for the dispose elements
          disposeSpeed: 1000, // how quickly they'll fadeOut/In
    
          delayBetweenTransition: 1000, // time between starting fadeOut and fadeIn
          delayAnimation: 7000, // time between auto changing the current frame
    
          loop: true, // if true when clicking next on the last frame the slider jumps to the first one
    
          autoStart: true, // start the automatic looping through the frames on init
    
          framesSelector: "section", // selector for the frames inside the slider
    
          elements: {
            "p": {delay: 100, speed: 1000, easing: "easeInOutBack"}
          },
    
          navigation: true, // the dots navigation on the bottom
          navigationClass: "slider-nav",
    
          // callbacks
          // another way to "catch" these events is with
          // $(-slider-element-).bind("animationStart")
          animationStart: null,
          animationEnd: null
        },
    
        init: function() {
          var c, e, element, $element,
              that = this,
              $firstFrame;
    
          c = this.config = $.extend({}, this.defaults, this.options);
    
          this.elem.style.position = "relative"; // make the wrapping element relative
    
          // basics
          this.$frames = this.$elem.find(c.framesSelector);
          this.framesCount = this.$frames.length;
          this.currentFrame = 0;
          this.queue = [];
    
          this._$elementsByFrame = {};
          this._$disposeElementsByFrame = {};
    
          for (i = 0; i < this.framesCount; i++) {
            this._$elementsByFrame[i] = this._getFrameElements(i); // cache the $elements by frame
            this._$disposeElementsByFrame[i] = this._getDisposeFrameElements(i); // cache the rest of the tree for each frame
          }
    
          if (c.navigation) {
            generateNavigation(this.$elem, this.framesCount, c);
            this.$navigation = this.$elem.find("."+c.navigationClass);
          }
    
          // bindings
          this.$elem.find(".slider-nav").delegate("a", "click", function(e){
            var frame = this.getAttribute("href").split("#")[1];
            that.go.call(that, frame);
            return false;
          });
    
          this.$elem // internal bindings for the callbacks
            .bind("animationStart", function(){
              if ($.isFunction(c.animationStart)) {c.animationStart.apply(that, arguments);}
            })
            .bind("animationEnd", function(){
              if ($.isFunction(c.animationEnd)) {c.animationEnd.apply(that, arguments);}
            })
          ;
    
          // start animation?
          if (c.autoStart) {
            this.start();
          } else {
            this.running = false;
          }
    
          return this;
        },
    
        start: function(instant) {
          var that = this;
    
          if (this.timer) { // we'll clear the current timer
            window.clearTimeout(this.timer);
          }
    
          this.running = true;
    
          if (instant) {
            that.nextFrame();
          } else {
            this.timer = window.setTimeout(function(){ that.nextFrame.call(that) }, that.config.delayAnimation);
          }
        },
    
        stop: function() {
          if (!this.running) return; // we are not running
    
          this.running = false;
          window.clearTimeout(this.timer);
        },
    
        // main function for changing frames
        selectFrame: function(frame, dfr) {
          var c = this.config, // shorthand for the config
              that = this,
              dfr = dfr || $.Deferred(),
              dFadeIn = $.Deferred(),
              dFadeOut = $.Deferred();
    
          if (isNaN(frame) || frame < 0 || frame > this.framesCount || frame === this.currentFrame) {
            dfr.reject();
            return dfr.promise();
          }
    
          // clear the animation loop interval if the animation is running
          if (this.running && this.timer) { 
            window.clearTimeout(this.timer);
          }
    
          // check if we are currenly running an animation.
          if (this.animated && this.queue.length > 0) {
            // wait for the last item in the queue to finish
            this.queue[this.queue.length-1].done(function(){
              that.selectFrame(frame, dfr); // and call again the selectFrame
            })
            return dfr.promise();
          }
    
          this.animated = true;
          this.$elem.trigger("animationStart", [this, frame]);
    
          this.queue.push(dfr);
    
          // fade the frames
          dFadeOut = this._fadeOutFrame(this.currentFrame);
    
          // hide the fadetout frame
          dFadeOut.done(function(){
            that.$frames.eq(that.currentFrame).hide();
          });
    
          window.setTimeout(function(){ // then wait delayBetweenTransition and fadeIn the new frame
            dFadeIn = that._fadeInFrame.call(that, frame).done(function(){
              // when both the fadeIn and fadeOut are done we'll resolve the selectFrame promise
              $.when(dFadeOut, dFadeIn).done(function(){
                that.animated = false;
                that.queue.shift();
                that.$elem.trigger("animationEnd", [that]);
                that.currentFrame = frame;
                dfr.resolve();
              });
            });
          }, c.delayBetweenTransition);
    
          // navigation html change
          if (this.config.navigation) {
            this.$navigation.find(".selected").removeClass("selected").end()
              .find("a").eq(frame).addClass("selected");
          }
    
          dfr.done(function(){ // we'll resume the loop animation after the transitions are done
            if (that.running) {
              that.start();
            }
          });
    
          return dfr.promise();
        },
    
        _fadeFrame: function(frame, callback, direction) {
          var dfr = $.Deferred(),
              $frame = this.$frames.eq(frame),
              $elements = this._$elementsByFrame[frame],
              windowWidth = $(window).width(), // cache it before the animations, so we don't have to check it for each element 
              i, len,
              that = this,
              elementAnimations = [],
              $disposeElements = this._$disposeElementsByFrame[frame],
              $affectedElements,
              frameLeft = $frame.offset().left;
    
          direction = direction || "out";
    
          if (!$.isFunction(callback)) return; // do nothing if there's no callback passed
    
          $affectedElements = $elements.add($disposeElements);
    
          // position absolute the animation and dispose elements
          absolutize($affectedElements);
    
          // toggle the dispose elements
          if ($disposeElements.length > 0) {
            window.setTimeout(function(){
              $disposeElements[direction === "out" ? "fadeOut" : "fadeIn"](that.config.disposeSpeed);
            }, this.config.disposeDelay);
          }
    
          // invoke the callback for each element
          // the callback must return a promise
          $elements.each(function(){
            elementAnimations.push( callback.call(that, $(this), windowWidth, frameLeft) );
          });
    
          // wait for all the elements to finish their animation
          $.when.apply(this, elementAnimations).done(function(){
            //restoreFrameElements($affectedElements); // and restore the elements' position
            dfr.resolve(); // resolve the fade function
          });
    
          return dfr.promise();
        },
    
        _fadeOutFrame: function(frame) {
          var dfr = $.Deferred(),
              $frame = this.$frames.eq(frame),
              $disposeElements = this._$disposeElementsByFrame[frame];
    
          this._fadeFrame(frame, this._animationOut, "out").done(function(){
            dfr.resolve();
          })
    
          return dfr.promise();
        },
    
        _fadeInFrame: function(frame) {
          var dfr = $.Deferred(),
              $frame = this.$frames.eq(frame),
              $elements = this._$elementsByFrame[frame];
    
          this._restoreFrame(frame);
    
          $frame.show();
    
          this._fadeFrame(frame, this._animationIn, "in").done(function(){
            dfr.resolve();
          });
    
          return dfr.promise();
        },
    
        _restoreFrame: function(frame){
          if (!frame) return
          restoreFrameElements( this._$elementsByFrame[frame].add(this._$disposeElementsByFrame[frame]) );
        },
    
        nextFrame: function() {
          var frame = this.currentFrame+1,
              dfr = $.Deferred();
    
          if (frame > this.framesCount-1) {
            if (this.config.loop) {
              frame = 0;
            } else {
              dfr.reject();
            }
          };
    
          this.selectFrame(frame).done(function(){
            dfr.resolve();
          });
    
          return dfr.promise();
        },
    
        prevFrame: function() {
          var frame = this.currentFrame-1,
              dfr = $.Deferred();
    
          if (frame < 0) {
            if (this.config.loop) {
              frame = this.framesCount-1;
            } else {
              dfr.reject();
              return dfr.promise();
            }
          }
    
          this.selectFrame(frame).done(function(){
            dfr.resolve();
          });
    
          return dfr.promise();
        },
    
        go: function(str) { // shorthand
          switch (str) {
            case "next":
            case "+1":
              this.nextFrame();
              break;
    
            case "prev":
            case "-1":
              this.prevFrame();
              break;
    
            case "first":
              this.selectFrame(0);
              break;
    
            case "last":
              this.selectFrame(this.framesCount-1);
              break;
    
            default:
              if (isNaN(str)) return;
              this.selectFrame(Number(str));
          }
        },
    
        // returns jquery collection of animation elements
        _getFrameElements: function(frame) { 
          var $frame = this.$frames.eq(frame),
              elements = this.config.elements,
              e, elementOptions,
              $found, $frameElements = $([]);
    
          for (e in elements) {
            elementOptions = elements[e];
            $found = $frame.find(e);
            $found.addClass("t-frame-element").data("tlrkAnimOptions", $.extend({}, this.defaults.defaultElementOptions, elementOptions ));
            $frameElements = $frameElements.add($found);
          }
    
          return $frameElements;
        },
    
        // returns jquery collection of elements that have to be faded out
        // i.e. elements on the same level as the animation elements
        // that doesn't contain other animation elements
        _getDisposeFrameElements: function(frame) {
          var $disposeElements = $([]),
              $frame = this.$frames.eq(frame),
              $elements = this._$elementsByFrame[frame];
    
          $elements.each(function(){
            var $t = $(this),
                $siblings = $t.siblings().not(".t-frame-element");
    
            $siblings.each(function(){
              var $t = $(this);
              // check if the node is not already marked and doesn't contains other frame elements
              if (!$t.hasClass("t-frame-dispose") && $t.find(".t-frame-element").length === 0) {
                $t.addClass("t-frame-dispose");
                $disposeElements = $disposeElements.add($t);
              }
            });
    
          });
          return $disposeElements;
        },
    
        // expose the internal animationIn/Out functions that are called for each element in the frame
        // two arguments are passed - the $element which have to be animated and the window width
        _animationIn: sweepIn,
        _animationOut: sweepOut
    
      }
    
      TlrkSlider.defaults = TlrkSlider.prototype.defaults;
    
      $.fn.tlrkSlider = function(options) {
        var otherArgs = Array.prototype.slice.call(arguments, 1);
    
        return this.each(function() {
          var $el = $(this),
              pluginData = $el.data("tlrkSlider");
    
          if (!pluginData) { // check if the slider is already attached
            pluginData = new TlrkSlider(this, options).init();
            $el.data("tlrkSlider", pluginData);
            return;
          }
    
          //change the options or call a method
          if (typeof options === "string") {
    
            // setting / getting option(s)
            if (options === "option") {
    
              if (typeof otherArgs[0] === "string" && typeof otherArgs[1] !== "undefined") { // set an option value
                pluginData.config[otherArgs[0]] = otherArgs[1]; 
              }
    
              if (typeof otherArgs[0] === "object") { // extend the config with new options
                pluginData.config = $.extend(pluginData.config, otherArgs[0]);
              }
    
            } else { // call a method?
              try {
                pluginData[options].apply(pluginData, otherArgs);
              } catch(ex) {
                throw "Error calling a plugin method (" + ex + ")";
              }
            }
          }
        });
      };
    
      window.TlrkSlider = TlrkSlider;
    
    })( jQuery, window , document );
    

    下边是页面调用的JS代码:

    $(document).ready(function(){
      var $backgrounds = $(".header-content").find(".parallax-bg"),
          LAYER_OFFSET = 30,
          PRLX_SPEED = 1500,
          $slider;
    
      $slider = $("#slider").tlrkSlider({
        autoStart: true,
        animationStart: function(ev, slider, step){
          var max_steps = this.framesCount; 
          $backgrounds.each(function(idx, el){
            var pos = (step * (100 / max_steps)) + (LAYER_OFFSET * idx);
            $(this).animate({"backgroundPosition": pos + "% 0"}, PRLX_SPEED);
          });
        },
        elements: {
          "img": {delay: 10},
          "h2": {delay: 500},
          ".copy": {delay: 800},
          ".button": {delay: 1000}
        }
      });
    
      $(".header-content")
        .hover(
          function(){$(this).find(".slider-prev, .slider-next").show();},
          function(){$(this).find(".slider-prev, .slider-next").hide();}
        )
        .find(".slider-prev").click(function(){$slider.tlrkSlider("go", "prev"); return false; }).end()
        .find(".slider-next").click(function(){$slider.tlrkSlider("go", "next"); return false; });
    
    });
    

    在线演示源码下载

    JavaScript代码

    /**
     * jquery.gallery.js
     * http://www.codrops.com
     *
     * Copyright 2011, Pedro Botelho / Codrops
     * Free to use under the MIT license.
     *
     * Date: Mon Jan 30 2012
     */
    
    (function( $, undefined ) {
    
        /*
         * Gallery object.
         */
        $.Gallery               = function( options, element ) {
    
            this.$el    = $( element );
            this._init( options );
    
        };
    
        $.Gallery.defaults      = {
            current     : 0,    // index of current item
            autoplay    : false,// slideshow on / off
            interval    : 2000  // time between transitions
        };
    
        $.Gallery.prototype     = {
            _init               : function( options ) {
    
                this.options        = $.extend( true, {}, $.Gallery.defaults, options );
    
                // support for 3d / 2d transforms and transitions
                this.support3d      = Modernizr.csstransforms3d;
                this.support2d      = Modernizr.csstransforms;
                this.supportTrans   = Modernizr.csstransitions;
    
                this.$wrapper       = this.$el.find('.dg-wrapper');
    
                this.$items         = this.$wrapper.children();
                this.itemsCount     = this.$items.length;
    
                this.$nav           = this.$el.find('nav');
                this.$navPrev       = this.$nav.find('.dg-prev');
                this.$navNext       = this.$nav.find('.dg-next');
    
                // minimum of 3 items
                if( this.itemsCount < 3 ) {
    
                    this.$nav.remove();
                    return false;
    
                }   
    
                this.current        = this.options.current;
    
                this.isAnim         = false;
    
                this.$items.css({
                    'opacity'   : 0,
                    'visibility': 'hidden'
                });
    
                this._validate();
    
                this._layout();
    
                // load the events
                this._loadEvents();
    
                // slideshow
                if( this.options.autoplay ) {
    
                    this._startSlideshow();
    
                }
    
            },
            _validate           : function() {
    
                if( this.options.current < 0 || this.options.current > this.itemsCount - 1 ) {
    
                    this.current = 0;
    
                }   
    
            },
            _layout             : function() {
    
                // current, left and right items
                this._setItems();
    
                // current item is not changed
                // left and right one are rotated and translated
                var leftCSS, rightCSS, currentCSS;
    
                if( this.support3d && this.supportTrans ) {
    
                    leftCSS     = {
                        '-webkit-transform' : 'translateX(-350px) translateZ(-200px) rotateY(45deg)',
                        '-moz-transform'    : 'translateX(-350px) translateZ(-200px) rotateY(45deg)',
                        '-o-transform'      : 'translateX(-350px) translateZ(-200px) rotateY(45deg)',
                        '-ms-transform'     : 'translateX(-350px) translateZ(-200px) rotateY(45deg)',
                        'transform'         : 'translateX(-350px) translateZ(-200px) rotateY(45deg)'
                    };
    
                    rightCSS    = {
                        '-webkit-transform' : 'translateX(350px) translateZ(-200px) rotateY(-45deg)',
                        '-moz-transform'    : 'translateX(350px) translateZ(-200px) rotateY(-45deg)',
                        '-o-transform'      : 'translateX(350px) translateZ(-200px) rotateY(-45deg)',
                        '-ms-transform'     : 'translateX(350px) translateZ(-200px) rotateY(-45deg)',
                        'transform'         : 'translateX(350px) translateZ(-200px) rotateY(-45deg)'
                    };
    
                    leftCSS.opacity     = 1;
                    leftCSS.visibility  = 'visible';
                    rightCSS.opacity    = 1;
                    rightCSS.visibility = 'visible';
    
                }
                else if( this.support2d && this.supportTrans ) {
    
                    leftCSS     = {
                        '-webkit-transform' : 'translate(-350px) scale(0.8)',
                        '-moz-transform'    : 'translate(-350px) scale(0.8)',
                        '-o-transform'      : 'translate(-350px) scale(0.8)',
                        '-ms-transform'     : 'translate(-350px) scale(0.8)',
                        'transform'         : 'translate(-350px) scale(0.8)'
                    };
    
                    rightCSS    = {
                        '-webkit-transform' : 'translate(350px) scale(0.8)',
                        '-moz-transform'    : 'translate(350px) scale(0.8)',
                        '-o-transform'      : 'translate(350px) scale(0.8)',
                        '-ms-transform'     : 'translate(350px) scale(0.8)',
                        'transform'         : 'translate(350px) scale(0.8)'
                    };
    
                    currentCSS  = {
                        'z-index'           : 999
                    };
    
                    leftCSS.opacity     = 1;
                    leftCSS.visibility  = 'visible';
                    rightCSS.opacity    = 1;
                    rightCSS.visibility = 'visible';
    
                }
    
                this.$leftItm.css( leftCSS || {} );
                this.$rightItm.css( rightCSS || {} );
    
                this.$currentItm.css( currentCSS || {} ).css({
                    'opacity'   : 1,
                    'visibility': 'visible'
                }).addClass('dg-center');
    
            },
            _setItems           : function() {
    
                this.$items.removeClass('dg-center');
    
                this.$currentItm    = this.$items.eq( this.current );
                this.$leftItm       = ( this.current === 0 ) ? this.$items.eq( this.itemsCount - 1 ) : this.$items.eq( this.current - 1 );
                this.$rightItm      = ( this.current === this.itemsCount - 1 ) ? this.$items.eq( 0 ) : this.$items.eq( this.current + 1 );
    
                if( !this.support3d && this.support2d && this.supportTrans ) {
    
                    this.$items.css( 'z-index', 1 );
                    this.$currentItm.css( 'z-index', 999 );
    
                }
    
                // next & previous items
                if( this.itemsCount > 3 ) {
    
                    // next item
                    this.$nextItm       = ( this.$rightItm.index() === this.itemsCount - 1 ) ? this.$items.eq( 0 ) : this.$rightItm.next();
                    this.$nextItm.css( this._getCoordinates('outright') );
    
                    // previous item
                    this.$prevItm       = ( this.$leftItm.index() === 0 ) ? this.$items.eq( this.itemsCount - 1 ) : this.$leftItm.prev();
                    this.$prevItm.css( this._getCoordinates('outleft') );
    
                }
    
            },
            _loadEvents         : function() {
    
                var _self   = this;
    
                this.$navPrev.on( 'click.gallery', function( event ) {
    
                    if( _self.options.autoplay ) {
    
                        clearTimeout( _self.slideshow );
                        _self.options.autoplay  = false;
    
                    }
    
                    _self._navigate('prev');
                    return false;
    
                });
    
                this.$navNext.on( 'click.gallery', function( event ) {
    
                    if( _self.options.autoplay ) {
    
                        clearTimeout( _self.slideshow );
                        _self.options.autoplay  = false;
    
                    }
    
                    _self._navigate('next');
                    return false;
    
                });
    
                this.$wrapper.on( 'webkitTransitionEnd.gallery transitionend.gallery OTransitionEnd.gallery', function( event ) {
    
                    _self.$currentItm.addClass('dg-center');
                    _self.$items.removeClass('dg-transition');
                    _self.isAnim    = false;
    
                });
    
            },
            _getCoordinates     : function( position ) {
    
                if( this.support3d && this.supportTrans ) {
    
                    switch( position ) {
                        case 'outleft':
                            return {
                                '-webkit-transform' : 'translateX(-450px) translateZ(-300px) rotateY(45deg)',
                                '-moz-transform'    : 'translateX(-450px) translateZ(-300px) rotateY(45deg)',
                                '-o-transform'      : 'translateX(-450px) translateZ(-300px) rotateY(45deg)',
                                '-ms-transform'     : 'translateX(-450px) translateZ(-300px) rotateY(45deg)',
                                'transform'         : 'translateX(-450px) translateZ(-300px) rotateY(45deg)',
                                'opacity'           : 0,
                                'visibility'        : 'hidden'
                            };
                            break;
                        case 'outright':
                            return {
                                '-webkit-transform' : 'translateX(450px) translateZ(-300px) rotateY(-45deg)',
                                '-moz-transform'    : 'translateX(450px) translateZ(-300px) rotateY(-45deg)',
                                '-o-transform'      : 'translateX(450px) translateZ(-300px) rotateY(-45deg)',
                                '-ms-transform'     : 'translateX(450px) translateZ(-300px) rotateY(-45deg)',
                                'transform'         : 'translateX(450px) translateZ(-300px) rotateY(-45deg)',
                                'opacity'           : 0,
                                'visibility'        : 'hidden'
                            };
                            break;
                        case 'left':
                            return {
                                '-webkit-transform' : 'translateX(-350px) translateZ(-200px) rotateY(45deg)',
                                '-moz-transform'    : 'translateX(-350px) translateZ(-200px) rotateY(45deg)',
                                '-o-transform'      : 'translateX(-350px) translateZ(-200px) rotateY(45deg)',
                                '-ms-transform'     : 'translateX(-350px) translateZ(-200px) rotateY(45deg)',
                                'transform'         : 'translateX(-350px) translateZ(-200px) rotateY(45deg)',
                                'opacity'           : 1,
                                'visibility'        : 'visible'
                            };
                            break;
                        case 'right':
                            return {
                                '-webkit-transform' : 'translateX(350px) translateZ(-200px) rotateY(-45deg)',
                                '-moz-transform'    : 'translateX(350px) translateZ(-200px) rotateY(-45deg)',
                                '-o-transform'      : 'translateX(350px) translateZ(-200px) rotateY(-45deg)',
                                '-ms-transform'     : 'translateX(350px) translateZ(-200px) rotateY(-45deg)',
                                'transform'         : 'translateX(350px) translateZ(-200px) rotateY(-45deg)',
                                'opacity'           : 1,
                                'visibility'        : 'visible'
                            };
                            break;
                        case 'center':
                            return {
                                '-webkit-transform' : 'translateX(0px) translateZ(0px) rotateY(0deg)',
                                '-moz-transform'    : 'translateX(0px) translateZ(0px) rotateY(0deg)',
                                '-o-transform'      : 'translateX(0px) translateZ(0px) rotateY(0deg)',
                                '-ms-transform'     : 'translateX(0px) translateZ(0px) rotateY(0deg)',
                                'transform'         : 'translateX(0px) translateZ(0px) rotateY(0deg)',
                                'opacity'           : 1,
                                'visibility'        : 'visible'
                            };
                            break;
                    };
    
                }
                else if( this.support2d && this.supportTrans ) {
    
                    switch( position ) {
                        case 'outleft':
                            return {
                                '-webkit-transform' : 'translate(-450px) scale(0.7)',
                                '-moz-transform'    : 'translate(-450px) scale(0.7)',
                                '-o-transform'      : 'translate(-450px) scale(0.7)',
                                '-ms-transform'     : 'translate(-450px) scale(0.7)',
                                'transform'         : 'translate(-450px) scale(0.7)',
                                'opacity'           : 0,
                                'visibility'        : 'hidden'
                            };
                            break;
                        case 'outright':
                            return {
                                '-webkit-transform' : 'translate(450px) scale(0.7)',
                                '-moz-transform'    : 'translate(450px) scale(0.7)',
                                '-o-transform'      : 'translate(450px) scale(0.7)',
                                '-ms-transform'     : 'translate(450px) scale(0.7)',
                                'transform'         : 'translate(450px) scale(0.7)',
                                'opacity'           : 0,
                                'visibility'        : 'hidden'
                            };
                            break;
                        case 'left':
                            return {
                                '-webkit-transform' : 'translate(-350px) scale(0.8)',
                                '-moz-transform'    : 'translate(-350px) scale(0.8)',
                                '-o-transform'      : 'translate(-350px) scale(0.8)',
                                '-ms-transform'     : 'translate(-350px) scale(0.8)',
                                'transform'         : 'translate(-350px) scale(0.8)',
                                'opacity'           : 1,
                                'visibility'        : 'visible'
                            };
                            break;
                        case 'right':
                            return {
                                '-webkit-transform' : 'translate(350px) scale(0.8)',
                                '-moz-transform'    : 'translate(350px) scale(0.8)',
                                '-o-transform'      : 'translate(350px) scale(0.8)',
                                '-ms-transform'     : 'translate(350px) scale(0.8)',
                                'transform'         : 'translate(350px) scale(0.8)',
                                'opacity'           : 1,
                                'visibility'        : 'visible'
                            };
                            break;
                        case 'center':
                            return {
                                '-webkit-transform' : 'translate(0px) scale(1)',
                                '-moz-transform'    : 'translate(0px) scale(1)',
                                '-o-transform'      : 'translate(0px) scale(1)',
                                '-ms-transform'     : 'translate(0px) scale(1)',
                                'transform'         : 'translate(0px) scale(1)',
                                'opacity'           : 1,
                                'visibility'        : 'visible'
                            };
                            break;
                    };
    
                }
                else {
    
                    switch( position ) {
                        case 'outleft'  : 
                        case 'outright' : 
                        case 'left'     : 
                        case 'right'    :
                            return {
                                'opacity'           : 0,
                                'visibility'        : 'hidden'
                            };
                            break;
                        case 'center'   :
                            return {
                                'opacity'           : 1,
                                'visibility'        : 'visible'
                            };
                            break;
                    };
    
                }
    
            },
            _navigate           : function( dir ) {
    
                if( this.supportTrans && this.isAnim )
                    return false;
    
                this.isAnim = true;
    
                switch( dir ) {
    
                    case 'next' :
    
                        this.current    = this.$rightItm.index();
    
                        // current item moves left
                        this.$currentItm.addClass('dg-transition').css( this._getCoordinates('left') );
    
                        // right item moves to the center
                        this.$rightItm.addClass('dg-transition').css( this._getCoordinates('center') ); 
    
                        // next item moves to the right
                        if( this.$nextItm ) {
    
                            // left item moves out
                            this.$leftItm.addClass('dg-transition').css( this._getCoordinates('outleft') );
    
                            this.$nextItm.addClass('dg-transition').css( this._getCoordinates('right') );
    
                        }
                        else {
    
                            // left item moves right
                            this.$leftItm.addClass('dg-transition').css( this._getCoordinates('right') );
    
                        }
                        break;
    
                    case 'prev' :
    
                        this.current    = this.$leftItm.index();
    
                        // current item moves right
                        this.$currentItm.addClass('dg-transition').css( this._getCoordinates('right') );
    
                        // left item moves to the center
                        this.$leftItm.addClass('dg-transition').css( this._getCoordinates('center') );
    
                        // prev item moves to the left
                        if( this.$prevItm ) {
    
                            // right item moves out
                            this.$rightItm.addClass('dg-transition').css( this._getCoordinates('outright') );
    
                            this.$prevItm.addClass('dg-transition').css( this._getCoordinates('left') );
    
                        }
                        else {
    
                            // right item moves left
                            this.$rightItm.addClass('dg-transition').css( this._getCoordinates('left') );
    
                        }
                        break;  
    
                };
    
                this._setItems();
    
                if( !this.supportTrans )
                    this.$currentItm.addClass('dg-center');
    
            },
            _startSlideshow     : function() {
    
                var _self   = this;
    
                this.slideshow  = setTimeout( function() {
    
                    _self._navigate( 'next' );
    
                    if( _self.options.autoplay ) {
    
                        _self._startSlideshow();
    
                    }
    
                }, this.options.interval );
    
            },
            destroy             : function() {
    
                this.$navPrev.off('.gallery');
                this.$navNext.off('.gallery');
                this.$wrapper.off('.gallery');
    
            }
        };
    
        var logError            = function( message ) {
            if ( this.console ) {
                console.error( message );
            }
        };
    
        $.fn.gallery            = function( options ) {
    
            if ( typeof options === 'string' ) {
    
                var args = Array.prototype.slice.call( arguments, 1 );
    
                this.each(function() {
    
                    var instance = $.data( this, 'gallery' );
    
                    if ( !instance ) {
                        logError( "cannot call methods on gallery prior to initialization; " +
                        "attempted to call method '" + options + "'" );
                        return;
                    }
    
                    if ( !$.isFunction( instance[options] ) || options.charAt(0) === "_" ) {
                        logError( "no such method '" + options + "' for gallery instance" );
                        return;
                    }
    
                    instance[ options ].apply( instance, args );
    
                });
    
            } 
            else {
    
                this.each(function() {
    
                    var instance = $.data( this, 'gallery' );
                    if ( !instance ) {
                        $.data( this, 'gallery', new $.Gallery( options, this ) );
                    }
                });
    
            }
    
            return this;
    
        };
    
    })( jQuery );
    

    在线演示源码下载

    本文由威尼斯手机平台登陆发布于威尼斯在线注册平台,转载请注明出处:付费投稿计划,1.HTML5+CSS3实现的模拟真人奔跑动画特效

    关键词: