$().ready(function(e) { $("#floatAd a").each(function(index, element) { var floatDiv = $("
"); floatDiv.append(this); $("body").prepend(floatDiv); startX = parseInt(Math.random() * 300); startY = parseInt(Math.random() * 50 + index * 150); divFloat("floatAd" + index.toString(), startX, startY); $("#floatAd" + index.toString() + " .a1").click(function(e) { var href = $(this).attr("data-href"); $(this).closest("a").attr("href",href); }); $("#floatAd" + index.toString() + " .a2").click(function(e) { var href = $(this).attr("data-href"); $(this).closest("a").attr("href",href); }); }); //鍥剧墖杞挱 if($(".banner .swiper-slide").length>1){ var mySwiper = new Swiper('.banner',{ autoplay : 5000, autoplayDisableOnInteraction : false, //鐢ㄦ埛鎿嶄綔鍚庝换鑷姩鍒囨崲 pagination: '.swiper-pagination', //鍒嗛〉鍣 paginationClickable :true, //寮€鍚偣鍑诲垎椤靛櫒鍒囨崲 loop: true, //寮€鍚惊鐜 //lazyLoading : true, //寮€鍚噿鍔犺浇 mousewheelControl : true, //榧犳爣婊氳疆鎺у埗 }) } if($(".picNews .swiper-slide").length>1){ var mySwiper = new Swiper('.picNews',{ autoplay : 5000, autoplayDisableOnInteraction : false, //鐢ㄦ埛鎿嶄綔鍚庝换鑷姩鍒囨崲 pagination: '.swiper-pagination', paginationClickable :true, loop: true, }) } //tab椤电鍒囨崲 $(".newsTab").each(function(index, element) { var hList = $(this).find(".indH .hList"); hList.eq(0).addClass("on"); var n = index + 1; var mySwiper = new Swiper ("#newsBox"+n, { loop: true, simulateTouch : false, //pagination: ".swiper-pagination", //鍒嗛〉鍣 //paginationClickable :true, //寮€鍚偣鍑诲垎椤靛櫒鍒囨崲 }) var more = $(this).find(".more a"); more.eq(1).hide(); hList.on("click",function(){ $(this).addClass("on").siblings().removeClass("on"); more.hide(); more.eq($(this).index()).show(); //婊氬姩鑷虫寚瀹氱殑index +1涓簊lide鐨勯〉鐮 //濡傛灉寮€鍚簡loop妯″紡 swiper鐨勯〉鐮佹槸浠?寮€濮嬶紝瑕?1锛?00涓哄垏鎹㈢殑闂撮殧姣鏁般€備笉寮€鍚痩oop鍒欎笉鐢?1銆 mySwiper.slideTo($(this).index()+1, 500, true) }) }); //鏍″洯鏂囧寲 if($(".xywh .bd ul li").length>5){ $(".xywh").slide({mainCell:".bd ul",autoPlay:true,effect:"leftMarquee",vis:5,interTime:50,trigger:"click"}); } $(".iLink ul li").each(function(index, element) { var i = index + 1; $(this).addClass("i"+i); }); //閾炬帴 $(".iLink ul li").each(function(index, element) { var i = index + 1; $(this).addClass("i"+i); }); });