最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

jQuery實(shí)現(xiàn)仿淘寶帶有指示條的圖片轉(zhuǎn)動(dòng)切換效果完整實(shí)例

 更新時(shí)間:2015年03月04日 09:22:04   作者:代碼家園  
這篇文章主要介紹了jQuery實(shí)現(xiàn)仿淘寶帶有指示條的圖片轉(zhuǎn)動(dòng)切換效果的方法,以完整實(shí)例形式較為詳細(xì)的分析了jQuery圖片特效的使用技巧,需要的朋友可以參考下

本文實(shí)例講述了jQuery實(shí)現(xiàn)仿淘寶帶有指示條的圖片轉(zhuǎn)動(dòng)切換效果的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:

復(fù)制代碼 代碼如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>jQuery仿淘寶帶有指示條的圖片轉(zhuǎn)動(dòng)切換結(jié)果</title>
<style type="text/css">
* {
 padding: 0;
 margin: 0
}
body {
 background-color: #EEE;
}
#slides {
 position:relative;
 width: 312px;
 margin: 0 auto
}
.slides_container {width:312px; height:145px}
.pagination {position:absolute; top:145px; left:0; width:312px; background-color: rgba(51, 51, 51, 0.5);
 -webkit-transform: translate3d(0, 0, 0);}
.pagination li {
 float: left;
 width: 104px;
 height: 3px;
 display: -webkit-box
}
.pagination li a {
 display: block;
 width: 104px;
 height: 3px;
 font-size: 0
}
.pagination li.current a {
 background-color: #FF4000
}
</style>
</head>
<body>
<div id="slides">
<div class="slides_container"> <a href="#" target="_blank"><img src="/images/m01.jpg" width="312" height="145" alt=""></a> <a href="#" target="_blank"><img src="/images/m02.jpg" width="312" height="145" alt=""></a> <a href="#" target="_blank"><img src="/images/m03.jpg" width="312" height="145" alt=""></a> </div>
</div>
<script src="js/jquery.min.js"></script>
<script>
(function(a){a.fn.slides=function(b){return b=a.extend({},a.fn.slides.option,b),this.each(function(){function w(g,h,i){if(!p&&o){p=!0,b.animationStart(n+1);switch(g){case"next":l=n,k=n+1,k=e===k?0:k,r=f*2,g=-f*2,n=k;break;case"prev":l=n,k=n-1,k=k===-1?e-1:k,r=0,g=0,n=k;break;case"pagination":k=parseInt(i,10),l=a("."+b.paginationClass+" li."+b.currentClass+" a",c).attr("href").match("[^#/]+$"),k>l?(r=f*2,g=-f*2):(r=0,g=0),n=k}h==="fade"?b.crossfade?d.children(":eq("+k+")",c).css({zIndex:10}).fadeIn(b.fadeSpeed,b.fadeEasing,function(){b.autoHeight?d.animate({height:d.children(":eq("+k+")",c).outerHeight()},b.autoHeightSpeed,function(){d.children(":eq("+l+")",c).css({display:"none",zIndex:0}),d.children(":eq("+k+")",c).css({zIndex:0}),b.animationComplete(k+1),p=!1}):(d.children(":eq("+l+")",c).css({display:"none",zIndex:0}),d.children(":eq("+k+")",c).css({zIndex:0}),b.animationComplete(k+1),p=!1)}):d.children(":eq("+l+")",c).fadeOut(b.fadeSpeed,b.fadeEasing,function(){b.autoHeight?d.animate({height:d.children(":eq("+k+")",c).outerHeight()},b.autoHeightSpeed,function(){d.children(":eq("+k+")",c).fadeIn(b.fadeSpeed,b.fadeEasing)}):d.children(":eq("+k+")",c).fadeIn(b.fadeSpeed,b.fadeEasing,function(){a.browser.msie&&a(this).get(0).style.removeAttribute("filter")}),b.animationComplete(k+1),p=!1}):(d.children(":eq("+k+")").css({left:r,display:"block"}),b.autoHeight?d.animate({left:g,height:d.children(":eq("+k+")").outerHeight()},b.slideSpeed,b.slideEasing,function(){d.css({left:-f}),d.children(":eq("+k+")").css({left:f,zIndex:5}),d.children(":eq("+l+")").css({left:f,display:"none",zIndex:0}),b.animationComplete(k+1),p=!1}):d.animate({left:g},b.slideSpeed,b.slideEasing,function(){d.css({left:-f}),d.children(":eq("+k+")").css({left:f,zIndex:5}),d.children(":eq("+l+")").css({left:f,display:"none",zIndex:0}),b.animationComplete(k+1),p=!1})),b.pagination&&(a("."+b.paginationClass+" li."+b.currentClass,c).removeClass(b.currentClass),a("."+b.paginationClass+" li:eq("+k+")",c).addClass(b.currentClass))}}function x(){clearInterval(c.data("interval"))}function y(){b.pause?(clearTimeout(c.data("pause")),clearInterval(c.data("interval")),u=setTimeout(function(){clearTimeout(c.data("pause")),v=setInterval(function(){w("next",i)},b.play),c.data("interval",v)},b.pause),c.data("pause",u)):x()}a("."+b.container,a(this)).children().wrapAll('<div class="slides_control"/>');var c=a(this),d=a(".slides_control",c),e=d.children().size(),f=d.children().outerWidth(),g=d.children().outerHeight(),h=b.start-1,i=b.effect.indexOf(",")<0?b.effect:b.effect.replace(" ","").split(",")[0],j=b.effect.indexOf(",")<0?i:b.effect.replace(" ","").split(",")[1],k=0,l=0,m=0,n=0,o,p,q,r,s,t,u,v;if(e<2)return a("."+b.container,a(this)).fadeIn(b.fadeSpeed,b.fadeEasing,function(){o=!0,b.slidesLoaded()}),a("."+b.next+", ."+b.prev).fadeOut(0),!1;if(e<2)return;h<0&&(h=0),h>e&&(h=e-1),b.start&&(n=h),b.randomize&&d.randomize(),a("."+b.container,c).css({overflow:"hidden",position:"relative"}),d.children().css({position:"absolute",top:0,left:d.children().outerWidth(),zIndex:0,display:"none"}),d.css({position:"relative",width:f*3,height:g,left:-f}),a("."+b.container,c).css({display:"block"}),b.autoHeight&&(d.children().css({height:"auto"}),d.animate({height:d.children(":eq("+h+")").outerHeight()},b.autoHeightSpeed));if(b.preload&&d.find("img:eq("+h+")").length){a("."+b.container,c).css({background:"url("+b.preloadImage+") no-repeat 50% 50%"});var z=d.find("img:eq("+h+")").attr("src")+"?"+(new Date).getTime();a("img",c).parent().attr("class")!="slides_control"?t=d.children(":eq(0)")[0].tagName.toLowerCase():t=d.find("img:eq("+h+")"),d.find("img:eq("+h+")").attr("src",z).load(function(){d.find(t+":eq("+h+")").fadeIn(b.fadeSpeed,b.fadeEasing,function(){a(this).css({zIndex:5}),a("."+b.container,c).css({background:""}),o=!0,b.slidesLoaded()})})}else d.children(":eq("+h+")").fadeIn(b.fadeSpeed,b.fadeEasing,function(){o=!0,b.slidesLoaded()});b.bigTarget&&(d.children().css({cursor:"pointer"}),d.children().click(function(){return w("next",i),!1})),b.hoverPause&&b.play&&(d.bind("mouseover",function(){x()}),d.bind("mouseleave",function(){y()})),b.generateNextPrev&&(a("."+b.container,c).after('<a href="#" class="'+b.prev+'">Prev</a>'),a("."+b.prev,c).after('<a href="#" class="'+b.next+'">Next</a>')),a("."+b.next,c).click(function(a){a.preventDefault(),b.play&&y(),w("next",i)}),a("."+b.prev,c).click(function(a){a.preventDefault(),b.play&&y(),w("prev",i)}),b.generatePagination?(b.prependPagination?c.prepend("<ul class="+b.paginationClass+"></ul>"):c.append("<ul class="+b.paginationClass+"></ul>"),d.children().each(function(){a("."+b.paginationClass,c).append('<li><a href="#'+m+'">'+(m+1)+"</a></li>"),m++})):a("."+b.paginationClass+" li a",c).each(function(){a(this).attr("href","#"+m),m++}),a("."+b.paginationClass+" li:eq("+h+")",c).addClass(b.currentClass),a("."+b.paginationClass+" li a",c).click(function(){return b.play&&y(),q=a(this).attr("href").match("[^#/]+$"),n!=q&&w("pagination",j,q),!1}),a("a.link",c).click(function(){return b.play&&y(),q=a(this).attr("href").match("[^#/]+$")-1,n!=q&&w("pagination",j,q),!1}),b.play&&(v=setInterval(function(){w("next",i)},b.play),c.data("interval",v))})},a.fn.slides.option={preload:!1,preloadImage:"/img/loading.gif",container:"slides_container",generateNextPrev:!1,next:"next",prev:"prev",pagination:!0,generatePagination:!0,prependPagination:!1,paginationClass:"pagination",currentClass:"current",fadeSpeed:350,fadeEasing:"",slideSpeed:350,slideEasing:"",start:1,effect:"slide",crossfade:!1,randomize:!1,play:0,pause:0,hoverPause:!1,autoHeight:!1,autoHeightSpeed:350,bigTarget:!1,animationStart:function(){},animationComplete:function(){},slidesLoaded:function(){}},a.fn.randomize=function(b){function c(){return Math.round(Math.random())-.5}return a(this).each(function(){var d=a(this),e=d.children(),f=e.length;if(f>1){e.hide();var g=[];for(i=0;i<f;i++)g[g.length]=i;g=g.sort(c),a.each(g,function(a,c){var f=e.eq(c),g=f.clone(!0);g.show().appendTo(d),b!==undefined&&b(f,g),f.remove()})}})}})(jQuery)
</script>
<script>
//slide effect
$(function(){
 $('#slides').slides({
  preload: true,
  preloadImage: '/images/loading.gif',
  play: 5000,
  pause: 2500,
  hoverPause: true
 });
});
</script>
</body>
</html>

希望本文所述對(duì)大家的jQuery程序設(shè)計(jì)有所幫助。

相關(guān)文章

  • jQuery EasyUI API 中文文檔 搜索框

    jQuery EasyUI API 中文文檔 搜索框

    jQuery EasyUI API 中文文檔 搜索框 SearchBox 搜索框使用介紹,需要的朋友可以參考下。
    2011-09-09
  • jQuery焦點(diǎn)圖左右轉(zhuǎn)換效果

    jQuery焦點(diǎn)圖左右轉(zhuǎn)換效果

    這篇文章主要為大家詳細(xì)介紹了jQuery焦點(diǎn)圖左右轉(zhuǎn)換效果,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2016-12-12
  • jQuery模擬爆炸倒計(jì)時(shí)功能實(shí)例代碼

    jQuery模擬爆炸倒計(jì)時(shí)功能實(shí)例代碼

    本文通過代碼給大家介紹了jQuery模擬爆炸倒計(jì)時(shí)功能實(shí)例代碼,非常不錯(cuò),代碼簡單易懂,需要的朋友參考下吧
    2017-08-08
  • 幻燈片帶網(wǎng)頁設(shè)計(jì)中的20個(gè)奇妙應(yīng)用示例小結(jié)

    幻燈片帶網(wǎng)頁設(shè)計(jì)中的20個(gè)奇妙應(yīng)用示例小結(jié)

    幻燈片效果在網(wǎng)站中的使用非常流行,使用幻燈片效果既能在有限的網(wǎng)頁空間內(nèi)展示更多的內(nèi)容,又能增強(qiáng)視覺趣味,網(wǎng)上眾多的幻燈片插件資源也使得幻燈片的實(shí)現(xiàn)變得十分簡單
    2012-05-05
  • 網(wǎng)站如何做到完全不需要jQuery也可以滿足簡單需求

    網(wǎng)站如何做到完全不需要jQuery也可以滿足簡單需求

    據(jù)統(tǒng)計(jì),目前全世界57.3%的網(wǎng)站使用它。也就是說,10個(gè)網(wǎng)站里面,有6個(gè)使用jQuery。如果只考察使用工具庫的網(wǎng)站,這個(gè)比例就會(huì)上升到驚人的91.7%
    2013-06-06
  • jQuery插件Tmpl的簡單使用方法

    jQuery插件Tmpl的簡單使用方法

    JavaScript 也可以利用模版來解決這些問題,比如基于 jQuery 的 jquery.tmpl,現(xiàn)在已經(jīng)被接受為官方的模版插件了。詳細(xì)的 API 在 jQuery 的 Templates 里,內(nèi)置的 demo 也盡情地演示了各種用法。
    2015-04-04
  • jQuery實(shí)現(xiàn)帶延時(shí)功能的水平多級(jí)菜單效果【附demo源碼下載】

    jQuery實(shí)現(xiàn)帶延時(shí)功能的水平多級(jí)菜單效果【附demo源碼下載】

    這篇文章主要介紹了jQuery實(shí)現(xiàn)帶延時(shí)功能的水平多級(jí)菜單效果,可實(shí)現(xiàn)響應(yīng)鼠標(biāo)事件延時(shí)展示菜單的功能,涉及jQuery結(jié)合時(shí)間函數(shù)動(dòng)態(tài)操作頁面元素屬性的相關(guān)技巧,需要的朋友可以參考下
    2016-09-09
  • 18個(gè)非常棒的jQuery代碼片段

    18個(gè)非常棒的jQuery代碼片段

    jQuery是當(dāng)今最流行Web開發(fā)必備javascript庫。本文收集了18個(gè)很棒的jQuery代碼片段,希望這些代碼片段能對(duì)大家有幫助。
    2015-11-11
  • jQuery簡單實(shí)現(xiàn)圖片預(yù)加載

    jQuery簡單實(shí)現(xiàn)圖片預(yù)加載

    我們在做網(wǎng)站的時(shí)候經(jīng)常會(huì)遇到這樣的問題:一個(gè)頁面有大量的圖片導(dǎo)致頁面加載速度緩慢,經(jīng)常會(huì)出現(xiàn)一個(gè)白頁用戶體驗(yàn)很不好。那么如何解決這個(gè)問題呢?下面我來介紹一種在實(shí)際應(yīng)用中經(jīng)常會(huì)使用到的js預(yù)加載的方法。
    2015-04-04
  • jQuery 使用個(gè)人心得

    jQuery 使用個(gè)人心得

    下面是jquery比較常用的一些操作實(shí)現(xiàn)方式。
    2009-02-02

最新評(píng)論

敦煌市| 宿迁市| 五寨县| 柳州市| 恩平市| 西宁市| 剑川县| 红原县| 湘阴县| 乐清市| 分宜县| 灵寿县| 西贡区| 麟游县| 洪湖市| 大渡口区| 宜川县| 江永县| 荣成市| 武隆县| 德化县| 南宫市| 房山区| 怀化市| 鸡西市| 右玉县| 灌阳县| 敖汉旗| 成武县| 盐池县| 凤山县| 荃湾区| 松溪县| 保山市| 平泉县| 平乐县| 宽城| 南阳市| 虹口区| 湖南省| 花莲县|