/*党建*/ function showlink2(no) { for (var i = 1; i <= 3 ; i++) { var bb = document.getElementById("fg" + i); var dd = document.getElementById("zx" + i); if (i == no) { dd.className = "indexpath2_l4dq"; bb.style.display = "block"; } else { dd.className = ""; bb.style.display = "none"; } } } function loadImg(type,index){ var pageImg = $("."+type).eq(index).find(".dataImg"); var imgLength = pageImg.length; for(var i=0;i < imgLength;i++){ var imgSrc = pageImg.eq(i).attr("data-original"); pageImg.eq(i).attr("src",imgSrc); } } $(document).ready(function() { if($('.banner').find(".swiper-slide").length>1){ var mySwiper = new Swiper('.banner',{ lazyLoading : true, //启动延迟加载 pagination: '.swiper-p1', loop:true, autoplay: 3000, grabCursor: true, paginationClickable: true, resizeReInit : true, onFirstInit: function() { var H = $(window).width()*468/1980; $(".banner .swiper-slide").css('height', H + 'px'); $(".banner .swiper-wrapper").css('height', H + 'px'); }, onSlideChangeStart:function(swiper){ var index = mySwiper.activeIndex; loadImg("banner-slide",index); } }); } /*新闻图*/ var sw = 0; $(".demo .num a").click(function () { sw = $(".num a").index(this); myShow(sw); }); function myShow(i) { $(".demo .num a").eq(i).addClass("cur").parent(".num2").siblings(".num2").find("a").removeClass("cur"); $(".demo ul li").not(".demo ul li:eq("+i+")").fadeOut(600,function(){ $(".demo ul li").not(".demo ul li:eq("+i+")").hide(); }); $(".demo ul li").eq(i).fadeIn(600); } $(".xyz").click(function () { myShow(sw); sw++; if (sw == 3) { sw = 0; } }); //滑入停止动画,滑出开始动画 $(".demo").hover(function () { if (myTime) { clearInterval(myTime); } }, function () { myTime = setInterval(function () { myShow(sw) sw++; if (sw == 3) { sw = 0; } }, 5000); }); //自动开始 if($(window).width()<1024){ var dwidth = $(".demo ul li").width(); var dheight = dwidth*57/83; $(".demo ul li").add(".demo").height(dheight); if($(window).width()>768) $(".content-text").height(dheight); } myShow(sw); sw++; var myTime = setInterval(function () { myShow(sw) sw++; if (sw == 3) { sw = 0; } }, 5000); /*永利55402官网*/ $("#title-ul li").click(function(){ var index=$(this).index(); $("#title-ul li").removeClass("active"); $(this).addClass("active"); $("#title-ul").parent().find(".more").hide(); $("#title-ul").parent().find(".more").eq(index).show(); $("#title-ul-tab>div").hide(); $("#title-ul-tab>div").eq(index).show(); }); /*企业*/ var swiper = new Swiper('.s-margin', { zoom: true, nextButton: '.swiper-button-next', prevButton: '.swiper-button-prev', loop:true, autoplay : 5000, resizeReInit : true, onFirstInit: function() { var H = $(".s-margin .s-cont").height(); $(".s-margin .swiper-slide").css('height', H + 'px'); $(".s-margin .swiper-wrapper").css('height', H + 'px'); }, onSlideChangeStart:function(swiper){ var index = swiper.activeIndex; loadImg("qiye-slide",index); } }); $('.swiper-button-prev').on('click', function(e){ e.preventDefault() swiper.swipePrev() }); $('.swiper-button-next').on('click', function(e){ e.preventDefault() swiper.swipeNext() }); function movelist(){ $('.com-cont>li:first-child').animate({'margin-top':'-30px'},2000,function(){ $(this).css({'margin-top':'0'}).appendTo('.com-cont') }); movetime=setTimeout(movelist,2500); } movelist(); $('.com-cont').hover(function(){ clearTimeout(movetime); },function(){ movelist(); }); /*专题专栏*/ if($('.topic').find(".swiper-slide").length>1){ console.log("22"); var topicSwiper = new Swiper('.topic',{ pagination: '.swiper-topic', loop:true, autoplay: 3000, paginationClickable: true, resizeReInit : true, onSlideChangeStart:function(swiper){ var index = swiper.activeIndex; loadImg("s-img",index); } /*onFirstInit: function() { var H = $(window).width()*468/1980; $(".banner .swiper-slide").css('height', H + 'px'); $(".banner .swiper-wrapper").css('height', H + 'px'); }*/ }); } });