window.onload=function(){ setTimeout(function(){ $('.second-show').addClass('hover'); $('.loading-box').fadeOut(500) },100) } $(document).ready(function(){ deviceWidth(); //杩斿洖椤堕儴 $('.returnTop').click(function(){ $('html,body').animate({scrollTop:0},300) }) }) function openFloat(){ if($('.right-float').hasClass('open')){ $('.right-float').removeClass('open') }else{ $('.right-float').addClass('open') } } $(window).resize(function(){ deviceWidth() }) function deviceWidth(){ var deviceWidth = document.documentElement.clientWidth; if(deviceWidth<1200){ if(deviceWidth > 1200) deviceWidth = 1200; document.documentElement.style.fontSize = deviceWidth / 12 + 'px' } if(deviceWidth<750){ if(deviceWidth > 750) deviceWidth = 750; document.documentElement.style.fontSize = deviceWidth / 7.5 + 'px' } } //瀵艰埅 begin $('[data-nav="navlist"] li').each(function(index){ if($(this).find('.drop-down').length>0){ $(this).addClass('d') } }) if($(window).width()<750){ $('[data-nav="navlist"] li').each(function(index){ if($(this).find('.drop-down').length>0 && index!=2){ $(this).find('.a').attr('onClick','dropDown(this)') } }) }else{ $('[data-nav="navlist"] li').hover(function(){ $(this).find('.drop-down').show() },function(){ $(this).find('.drop-down').hide() }) } function dropDown(e){ $(e).parent().addClass('hover'); $(e).parent().siblings().removeClass('hover'); if($(e).hasClass('on')){ $(e).removeClass('on'); $(e).parent().find(".drop-down").slideUp(500) }else{ $(e).addClass('on'); $(e).parent().find(".drop-down").slideDown(500) } } $('[data-nav="switch"]').click(function(){ $('[data-search="button"]').removeClass('hover') $('[data-search="show"]').hide() if($(this).hasClass('on')){ $(this).removeClass('on'); $('[data-nav="navlist"]').slideUp(500) }else{ $(this).addClass('on'); $('[data-nav="navlist"]').slideDown(500) } }) //瀵艰埅 end //鍏充簬鎴戜滑- 鍏徃澶т簨璁 if($(window).width()>750){ if($(window).width()>1200){ var n=4 }else{ var n=3 } var swiper = new Swiper('.swiper-events .swiper-container',{ slidesPerView:n, spaceBetween:0, //mousewheel:true, navigation:{ prevEl:'.swiper-events .swiper-prev', nextEl:'.swiper-events .swiper-next' } }) } $('.swiper-course .swiper-slide').eq(0).addClass('hover'); $('.swiper-course .swiper-slide').click(function(){ $(this).addClass('hover').siblings().removeClass('hover'); $('[data-tab="boxdiv"] .course-list').addClass('hide'); $('[data-tab="boxdiv"] .course-list').eq($(this).index()).removeClass('hide') }) $('[data-tab="box"] [data-tab="nav"] li').click(function(){ $(this).addClass('hover').siblings().removeClass('hover'); $(this).parents('[data-tab="box"]').find('[data-tab="boxdiv"] [data-tab="li"]').addClass('hide'); $(this).parents('[data-tab="box"]').find('[data-tab="boxdiv"] [data-tab="li"]').eq($(this).index()).removeClass('hide') }) $('[data-new="notice"] li').each(function(index){ if($(this).find('[data-time="start"]').length>0){ function_name($(this).find('[data-time="start"]').data('date'),$(this),$(this).find('[data-time="end"]').data('date')) } }); function function_name(time,obj,end){ $.leftTime(time, function(d){ if(d.status){ var $this = $(obj); $this.find('[data-time="start"]').html(''+d.d+''+d.h+''+d.m+''+d.s+'绉?); }else{ var $this = $(obj); $this.find('.txt').addClass('goon').html('杩涜涓?) } }); $.leftTime(end, function(d){ if(d.status){ ; }else{ var $this = $(obj); $this.find('.txt').addClass('goon').html('宸茬粨鏉?) } }); } /*var iframe = document.createElement("iframe"); iframe.src = "https://www.fqixin.cn/fsh5/smart-form/index.html?cardId=60f52b2d64f7e361552b41d9"; //document.body.appendChild(iframe); $('.contact_pop .pa').append(iframe); */ function rightContact(e){ $('.contact_pop .pa').show() $('.contact_pop .pa iframe').attr({src:e}) $('.contact_pop').fadeIn() $('.contact_pop .pa').scrollTop(0) } function contactClose(){ $('.contact_pop').fadeOut() } $.ajaxSetup({ headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') } }); //鏂板瀵艰埅鎼滅储js $('[data-search="button"]').click(function(){ $('[data-nav="switch"]').removeClass('on') $('[data-nav="navlist"]').slideDown(0) if($(this).hasClass('hover')){ $(this).removeClass('hover') $('[data-search="show"]').fadeOut(0) }else{ $(this).addClass('hover') $('[data-search="show"]').fadeIn(0) } }) function productVideo(video,img){ $('[data-product="video"]').html('') $('.productVideo-pop').fadeIn() } $('[data-product="close"]').click(function(){ $(this).parent().parent().fadeOut() $('[data-product="video"]').html('') }) /** 鍗囩増璇存槑 */ $('[data-history="updagebnt"]').click(function(){ if($(this).hasClass('open')){ $(this).removeClass('open') $(this).next('[data-history="updagelist"]').slideUp() }else{ $(this).addClass('open') $(this).next('[data-history="updagelist"]').slideDown() } }) // 鍗囩増璇存槑瀵艰埅 begin $('[data-nav="upgradenavlist"] li').each(function(index){ if($(this).find('.drop-down').length>0){ $(this).addClass('d') } }) $('[data-nav="upgradenavlist"] li').hover(function(){ $(this).find('.drop-down').show() },function(){ $(this).find('.drop-down').hide() }) function submitupgradeform(product,sort='',datatype='',category=""){ if(product!==""){ $("#upgradeform input[name='product']").val(product==-1?'':product) } if(sort!==""){ $("#upgradeform input[name='sort']").val(sort) } if(category!==""){ $("#upgradeform input[name='category']").val(category==-1?'':category) } if(datatype!==""){ $("#upgradeform input[name='category']").val(''); $("#upgradeform input[name='dataType']").val(datatype) } document.getElementById('upgradeform').submit(); }