var curIndex = 0; var time = 800; var slideTime = 5000; var adTxt = $("#banner_img>li>div>.ad_txt"); var adImg = $("#banner_img>li>div>.ad_img"); var int = setInterval("autoSlide()", slideTime); $("#banner_ctr>ul>li[class!='first-item'][class!='last-item']").click(function () { show($(this).index("#banner_ctr>ul>li[class!='first-item'][class!='last-item']")); window.clearInterval(int); int = setInterval("autoSlide()", slideTime); }); function autoSlide() { curIndex + 1 >= $("#banner_img>li").size() ? curIndex = -1 : false; show(curIndex + 1); } function show(index) { $.easing.def = "easeOutQuad"; $("#drag_ctr,#drag_arrow").stop(false, true).animate({ left: index * 115 + 20 }, 300); $("#banner_img>li").eq(curIndex).stop(false, true).fadeOut(time); adTxt.eq(curIndex).stop(false, true).animate({ top: "340px" }, time); adImg.eq(curIndex).stop(false, true).animate({ right: "120px" }, time); setTimeout(function () { $("#banner_img>li").eq(index).stop(false, true).fadeIn(time); adTxt.eq(index).children("p").css({ paddingTop: "50px", paddingBottom: "50px" }).stop(false, true).animate({ paddingTop: "0", paddingBottom: "0" }, time); adTxt.eq(index).css({ top: "0", opacity: "0" }).stop(false, true).animate({ top: "170px", opacity: "1" }, time); adImg.eq(index).css({ right: "-50px", opacity: "0" }).stop(false, true).animate({ right: "10px", opacity: "1" }, time); }, 200) curIndex = index; }
XHTMT|
HTML5|
CSS|
HTML DOM|
jQuery|
JSON|
AJAX|
LESS|
HTML|
Bootstrap|
Foundation|
AngularJS|
Ember.js|
TypeScript|
AngularJS2|
React|
jQuery UI|
jQuery EasyUI|
Node.js|
Highcharts|
Echarts|
Vue.js|
CoffeeScript|
Ext.js|
Meteor|
SASS|
Omi|
Markdown|
前端开发规范|
浏览器|
webpack|
JavaScript|
CSS3|
用户登录
还没有账号?立即注册
用户注册
投稿取消
文章分类: |
|
还能输入300字
上传中....