$(document).ready(function(){ //$("#list-box-first").find("ul.fl li:first").addClass("one"); //$("#list-box-first").find("ul.fr li:first").addClass("one"); //$("#list-box-first").find("ul li:lt(2)").addClass("one"); //$(".con-p1 ul li:lt(3)").addClass("one"); try{ //棰??剧缉? function topBg(){ if($(window).width()>1000 && $(window).width()<1920){ var topHeight = $(window).width() * 600 / 1920; $("body").css("background","none"); $(".topBanner").css({ "background-image":"url(images/bannerBg.jpg)", "background-position":"center top", "background-repeat":"no-repeat", "background-size":"cover", "height": topHeight }); $(".nav").css({ "width":"100%", "background-color":"#d53023" }) } } $(window).on("resize",function(){ //topBg(); }); //topBg(); }catch(e){} try{ // $("#focusBox").Tab({ // ChangeTime: 4000, // Obutton : true // }); }catch(e){} try{ // $("#navul > li").not(".navhome").hover(function(){ // $(this).addClass("navmoon"); // $(this).find("ul").fadeIn(); // //$(this).find("ul").toggle("fast"); // },function(){ // $(this).removeClass("navmoon"); // $(this).find("ul").fadeOut(); // //$(this).find("ul").toggle("fast"); // }); }catch(e){} try{ // if($(window).height()>870){ // $(".fixBox").show(); // }else{ // $(".fixBox").hide(); // } // $(window).scroll(function() { // var nowH = $(window).scrollTop(); // var cNum = 870 - $(window).height(); // if( nowH > cNum ){ // $(".fixBox").show(); // }else{ // $(".fixBox").hide(); // } // }); }catch(e){} try{ // var fixPaperNum = $(".fixPaper").offset().top; // $(window).scroll(function() { // //console.log( $(".fixPaper").css("top") ); // //console.log( $(".fixPaper").offset().top ); // //console.log( $(document).scrollTop() ); // var bodyTopNum = $(document).scrollTop(); // var offsetNum = 10; // if( bodyTopNum > fixPaperNum ){ // offsetNum = bodyTopNum - fixPaperNum + 40; // } // $(".fixPaper").animate({ top: offsetNum }, { duration: 500, queue: false }); // }); }catch(e){} try{ $(".con-p3").find("li").eq(0).addClass("one"); $(".con-p3-a").find("li").eq(0).addClass("one"); // console.log(1); }catch(e){} try{ var swiper_main = new Swiper('#swiper-container-main', { mode: 'horizontal', autoplay: 5000, autoplayDisableOnInteraction: false, loop: true, slidesPerView: 1, slidesPerGroup: 1, pagination: '.swiper-pagination-main', paginationClickable: true, mousewheelControl: false, onSlideChangeEnd: function(swiper){ } }); $("#swiper-container-main").mouseenter(function () {//婊?杩????? swiper_main.stopAutoplay(); }).mouseleave(function () {//绂诲?寮?? swiper_main.startAutoplay(); }); $(".swiper-pagination-main span.swiper-pagination-switch").hover(function() { $(this).click(); //榧?????涓??讳???锛????ㄨЕ???瑰?讳?浠舵?ユā浠块?????涓??荤??浜?浠 //swiper_main.stopAutoplay(); },function() { swiper_main.startAutoplay(); //榧???绉诲?轰???锛????ㄨ疆???? }) }catch(e){} try{ /*p5*/ //var p5Len = $(".swiper-container-p5").find("div.swiper-slide").length; //if(p5Len!=1){ //} var swiper_pic = new Swiper('.swiper-container-pic', { mode: 'horizontal', autoplay: 5000, autoplayDisableOnInteraction: false, loop: true, slidesPerView: 1, slidesPerGroup: 1, pagination: '.swiper-pagination-pic', paginationClickable: true, mousewheelControl: false, onSlideChangeEnd: function(swiper){ } }); $(".prev-pic").show(); $(".next-pic").show(); $(".swiper-container-pic").mouseenter(function () {//婊?杩????? swiper_pic.stopAutoplay(); }).mouseleave(function () {//绂诲?寮?? swiper_pic.startAutoplay(); }); $(document).on("click", ".prev-pic", function (e) { e.preventDefault() swiper_pic.swipePrev(); }); $(document).on("click", ".next-pic", function (e) { e.preventDefault() swiper_pic.swipeNext(); }); }catch(e){} try{ $('.ifrBox').each(function (idx) { var url = $(this).data('url'); var selt = $(this); $.ajax(url).done(function (result) { selt.html(result); $(".dropdown").hover( function(){ $(this).find(".linklist").show(); },function(){ $(this).find(".linklist").slideUp(300); } ); }); }); }catch(e){} try{ $(".tabBox").hide(); $(".tabBox").eq(0).show(); $(".tabTitle li").eq(0).addClass("active"); $(".tabTitle li").each(function(index, element) { $(this).mouseover(function(){ $(".tabTitle li").removeClass("active"); $(this).addClass("active"); $(".tabBox").hide(); $(".tabBox").eq(index).show(); }) }); }catch(e){} /*loadMorePic*/ function openlist(ns){ $('.tu_content li').each(function(index, element) { if(index < ns){ $(this).show(); } }); } openlist(9); var nc = 3; var nlength = $('.tu_content li').length; //console.log(nlength); $(window).scroll(function() { if($(window).scrollTop()+$(window).height()+55>$(document).height()) { var len = $('.tu_content li').length; if(nc < nlength){ nc = nc+3; openlist(nc); if(len == nc){ $(".loadmore").show(); } } } }); /*scroll*/ function scrollContent(ctId, id1, id2) { var speed=80; var $$=function(id){return document.getElementById(id);} $$(id2).innerHTML= $$(id1).innerHTML; function roll(){ if($$(id2).offsetTop-$$(ctId).scrollTop<=0) { //褰?婊??ㄥ?扮?浜??ㄥ????椤堕?ㄤ?缃?? $$(ctId).scrollTop-=$$(id1).offsetHeight; //??缃??崇?涓??ㄥ??椤堕?ㄤ?缃??稿?浜?$$('box').scrollTop=0; } else{ $$(ctId).scrollTop++ ; } } var start=setInterval(roll,speed); $$(ctId).onmouseover=function() {clearInterval(start)}; $$(ctId).onmouseout=function() {start=setInterval(roll,speed)}; } try{ scrollContent('demo', 'demo1', 'demo2'); } catch(e){} });