// 2018.6.9 澶勭悊绉诲姩绔粴鍔ㄧ┛閫 var distanceY=0; var ismove=false; $(".select .select-conbox .select-con").on("touchstart",function(ev){ distanceY=ev.originalEvent.targetTouches[0].pageY; ev.preventDefault() ev.stopPropagation(); }) $(".select .select-con").on("touchend",function(ev){ var _this=$(ev.target); Math.abs(ev.originalEvent.changedTouches[0].pageY-distanceY)<5?ismove=true:1; distanceY=0; if(ismove&&$(ev.target).get(0).tagName=="LI"||$(ev.target).get(0).tagName=="li"){ _this.click(); ismove=false; } }) function showDia(text1,isture){ text1=text1||'淇℃伅鎻愪氦涓?; isture=isture||false; console.log(isture); if(isture){ $(".loading_dialog").addClass('on'); } $(".loading_dialog .text .info").text(text1); $(".loading_dialog").fadeIn(); setTimeout(function(){ hideDia(); },2000) } function hideDia(){ $(".loading_dialog").removeClass('on'); $(".loading_dialog").fadeOut(); } $(".loading_dialog .backbtn").on('click',function(){ hideDia(); }) $(function(){ $('body,html').click( function() { $(".select .select-tit.on").click(); }); $("body").children().click(function () { //杩欓噷涓嶈鍐欎换浣曚唬鐮 }); $(".select").on("click",function(ev){ev.stopPropagation()}) $(window).scroll(function(){ $(".select .select-tit.on").click(); }) if($(window).width()>768){ $("video").each(function(index, el) { if($(this).attr("my-autoplay")=='true'){ $(this).attr("autoplay","true"); // $(this).get(0).play(); } }); } var wow = new WOW({ boxClass: 'wow', animateClass: 'animated', offset:200, mobile: false, live: true }); wow.init(); var time; var timeHead2; var timeHead3; $('.pronavbar').hover(function(){ clearTimeout(timeHead2); clearTimeout(timeHead3); $('header.pchad').addClass('godown'); time=setTimeout(function(){ $('.pornav').stop().fadeIn(); },320) },function(){ // clearTimeout(time); // $('header.pchad').removeClass('godown'); // $('.pornav').stop().hide(0); clearTimeout(time); clearTimeout(timeHead2); clearTimeout(timeHead3); timeHead2=setTimeout(function(){ $('header.pchad').removeClass('godown'); },80) timeHead3=setTimeout(function(){ $('.pornav').stop().fadeOut(200); },80) }) var time2; $('#main .avenuebox').hover(function(){ clearTimeout(time2); $('header.pchad').addClass('godown2'); },function(){ clearTimeout(time2); time2=setTimeout(function(){ $('header.pchad').removeClass('godown2'); },100); }) $('header.pchad .searbox').on('click',function(){ var _this=$(this); if(!_this.hasClass('on')){ $(".select .select-tit.on").click(); $('#main header.pchad').addClass('fff'); _this.addClass('on'); } }) $('header.pchad .searbox .contai .close-se').on('click',function(ev){ ev.stopPropagation(); $('header.pchad .searbox .ajaxsear').hide(); $('#main header.pchad').removeClass('fff'); $('header.pchad .searbox').removeClass('on'); }) $(window).on('scroll',function(){ if($(this).scrollTop()>$('.i-ban').height()){ $('#main header.pchad').addClass('bai'); } else{ $('#main header.pchad').removeClass('bai'); } }) // $('footer .fwrap .f2 .tel .ico-wx').on('click',function(){ // var _this=$(this); // if(!_this.hasClass('on')){ // _this.addClass('on'); // $('.wxbox').fadeIn(); // } // else{ // _this.removeClass('on'); // $('.wxbox').fadeOut(); // } // }) // $('.wxbox .bd_weixin_popup_close').on('click',function(){ // $('footer .fwrap .f2 .tel .ico-wx.on').removeClass('on'); // $('.wxbox').fadeOut(); // }) // 鎵嬫満 $("header .nav-btn").on('click', function() { var _this = $(this); if (!_this.hasClass('hover')) { $(".select .select-tit.on").click(); $('header.header2 .search-btn.on').click(); _this.parents('header').addClass('onnav'); _this.addClass('hover'); // _this.children('.line1').stop().transition({rotate: 45}, 300); _this.children('.line2').stop().fadeOut(300); // _this.children('.line3').stop().transition({rotate: -45}, 300,function(){ // _this.addClass('active'); // }); _this.parent(".main-wrap").siblings('.sub-menu').stop().fadeIn(); // $("header .list-cont").addClass('active'); }else{ _this.parents('header').removeClass('onnav'); _this.removeClass('hover'); _this.removeClass('active'); // _this.children('.line1').stop().transition({rotate: 0}, 300); _this.children('.line2').stop().fadeIn(300); // _this.children('.line3').stop().transition({rotate: 0}, 300); _this.parent(".main-wrap").siblings('.sub-menu').stop().fadeOut(); // $("header .list-cont").removeClass('active'); } }); $(".lang-sele .stit").on('click', function() { if ($(this).hasClass('on')) { $(this).removeClass('on'); $(".lang-sele .sub-box").stop().slideUp(); }else{ $(this).addClass('on'); $(".lang-sele .sub-box").stop().slideDown(); } }); $("header .sub-menu .sub-tit").on('click', function() { if ($(this).siblings('.sec-list').is(':hidden')){ $(this).addClass('on'); $(this).siblings('.sec-list').stop().slideDown(); $(this).parent().siblings('li').children('.sec-list').stop().slideUp().siblings('.tit').removeClass('on'); }else{ $(this).removeClass('on'); $(this).siblings('.sec-list').stop().slideUp(); } }); $("header .search-btn").on('click', function() { window.location.href = '/search/product.html' // $(".search-bg,.m-search-box,.m-close-search").stop().show(); }); $(".m-close-search").on('click', function() { $(".search-bg,.m-search-box,.m-close-search").stop().hide(); }) // $('header.header2 .search-btn').on('click', function (ev) { // var _this = $(this); // if (!_this.hasClass('on')) { // $(".select .select-tit.on").click(); // $('header.header2 .nav-btn.hover').click(); // $('#searbox').fadeIn().addClass('show'); // _this.addClass('on'); // _this.parents('header').addClass('sech'); // $('#boxSelectStr').trigger('keyup'); // } else { // $('#searbox').removeClass('show'); // setTimeout(function () { // $('#searbox').fadeOut(); // _this.removeClass('on'); // _this.parents('header').removeClass('sech'); // }, 800) // } // }); $(".header2 .sub-sear").click(function () { $("header.header2 .search-btn").click(); }) $(".f-side .d1 em").on("click",function(){ var _this=$(this); $(".f-side").fadeOut(); }) $(".select").on("mousewheel",function(){ 銆€銆€return false; }) }); // 鍊掕鏃 function Count_down(el,fun){ $(el).on('click',function(){ var _this=$(this); var i=30; var time; if(!_this.hasClass('on')){ _this.addClass('on'); fun?fun():1; _this.html(i+"s鍚庨噸鏂拌幏鍙?); time=setInterval(function(){ _this.html(--i+"s鍚庨噸鏂拌幏鍙?); if(!i){ clearInterval(time); _this.removeClass('on').html("鑾峰彇楠岃瘉鐮?); } },1000) } }) }