jQuery(".focusBox").slide({ titCell:".num li", mainCell:".pic",effect:"fold", autoPlay:true,trigger:"click", //下面startFun代码用于控制文字上下切换 startFun:function(i){ jQuery(".focusBox .txt li").eq(i).animate({"bottom":0}).siblings().animate({"bottom":-36}); } }); $(document).ready(function () { $(".tab li").mouseover(function () { $(this).addClass('cur').siblings().removeClass('cur'); $('.tab_list').hide().eq($(this).index()).show(); }); }); $(document).ready(function () { $(".tab1 li").mouseover(function () { $(this).addClass('cur1').siblings().removeClass('cur1'); $('.tab_list1').hide().eq($(this).index()).show(); }); }); $(document).ready(function () { $(".tab2 li").mouseover(function () { $(this).addClass('cur2').siblings().removeClass('cur2'); $('.tab_list2').hide().eq($(this).index()).show(); }); }); // // //var mySwiper = new Swiper('.swiper-container',{ // pagination: '.pagination', // loop:true, // autoplay:3000, // grabCursor: true, // paginationClickable: true //}) //$('.arrow-left').on('click', function(e){ // e.preventDefault() // mySwiper.swipePrev() //}) //$('.arrow-right').on('click', function(e){ // e.preventDefault() // mySwiper.swipeNext() //}) // function browserRedirect() { var sUserAgent = navigator.userAgent.toLowerCase(); var bIsIpad = sUserAgent.match(/ipad/i) == "ipad"; var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os"; var bIsMidp = sUserAgent.match(/midp/i) == "midp"; var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4"; var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb"; var bIsAndroid = sUserAgent.match(/android/i) == "android"; var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce"; var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile"; if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM) { console.log("phone"); } else { var turn = function (target, time, opts) { target.find('span').hover(function () { $(this).find('img').stop().animate(opts[0], time, function () { $(this).hide().next().show(); $(this).next().animate(opts[1], time); }); }, function () { $(this).find('.info').animate(opts[0], time, function () { $(this).hide().prev().show(); $(this).prev().animate(opts[1], time); }); }); } var verticalOpts = [{'width': 0}, {'width': '100%'}]; turn($('#vertical'), 100, verticalOpts); var horizontalOpts = [{'height': 0, 'top': '120px'}, {'height': 'auto', 'top': 0}]; turn($('#horizontal'), 100, horizontalOpts); } }; browserRedirect(); Nav('#nav');;//导航 navMin(); //手机端下拉菜单 snavWidth();//导航子菜单的宽度 Menu('.in_mbtn','.navm');//手机版导航 ImgHeight(); SerMax() //搜索框 cover(); // 2.添加窗口滚动事件 $(window).scroll(function(){ //3.获取滚动条的位置 var sTop = $(this).scrollTop(); //3.1获取屏幕高度 var height = $(window).height(); //4.判断滚动条位置 是否> >= 某个值 让其显示 否则隐藏 if(sTop>=height){ $('.ret').fadeIn(); }else{ $('.ret').fadeOut(); } // console.log(sTop); }); //5.单击返回顶部 $('.ret').click(function(){ //6.兼容写法 返回顶部 $('html,body').animate({scrollTop:0}); }); lastScrollY=0; function heartBeat(){ var diffY; if (document.documentElement && document.documentElement.scrollTop) diffY = document.documentElement.scrollTop; else if (document.body) diffY = document.body.scrollTop else {/*Netscape stuff*/} percent=.1*(diffY-lastScrollY); if(percent>0)percent=Math.ceil(percent); else percent=Math.floor(percent); document.getElementById("zxfw").style.top=parseInt(document.getElementById("zxfw").style.top)+percent+"px"; lastScrollY=lastScrollY+percent; } window.setInterval("heartBeat()",1); //1366悬浮 //lastScrollY=0; // //function heartBeat(){ // // var diffY; // // if (document.documentElement && document.documentElement.scrollTop) // // diffY = document.documentElement.scrollTop; // // else if (document.body) // // diffY = document.body.scrollTop // // else // // {/*Netscape stuff*/} // // // // percent=.1*(diffY-lastScrollY); // // if(percent>0)percent=Math.ceil(percent); // // else percent=Math.floor(percent); // // document.getElementById("zxfw2").style.top=parseInt(document.getElementById("zxfw2").style.top)+percent+"px"; // // // // // lastScrollY=lastScrollY+percent; // //} // //window.setInterval("heartBeat()",1); window.onload = function (){ // $('.zt').hide(); // $('.loading').hide(); // window.onscroll = function (){ // var scrollTop = document.body.scrollTop || document.documentElement.scrollTop; // // console.log(scrollTop) // if (scrollTop >= 600) { // if ($('.zt').css('display') == 'block') { // // }else{ // $('.loading').show(); // setTimeout(function (){ // $('.loading').hide(); // $('.w').show(); // }, 1500); // }; // // }else{ // $('.zt').hide(); // }; // } // //if(screen.width>1366) if(screen.width>1366) { var id="zxfw";document.getElementById(id).className="zxfwdisplay"; } else{ var id="zxfw2";document.getElementById(id).className="zxfwdisplay"; } }