$(function(){ $(".main_nav>ul>li").hover(function(){ $(this).children('ul').stop(true,true).show(300); },function(){ $(this).children('ul').stop(true,true).hide(300); }); // $(".main_nav .dropdown").hover(function(){ // $(this).addClass('on'); // $(this).children('.dropdown-menu').stop().fadeToggle().toggleClass('fadeInDownSmall'); // $(this).children('.dropdown-menu').removeClass('fadeOutUpSmall'); // },function(){ // $(this).removeClass('on'); // $(this).children('.dropdown-menu').stop().fadeToggle().toggleClass('fadeOutUpSmall'); // $(this).children('.dropdown-menu').removeClass('fadeInDownSmall'); // }); }); $(function(){ $(".f_links .dropdown").hover(function(){ $(this).addClass('on'); $(this).children('.dropdown-menu').stop().fadeToggle().toggleClass('fadeInDownSmall'); $(this).children('.dropdown-menu').addClass('animated-fast').removeClass('fadeOutUpSmall'); },function(){ $(this).removeClass('on'); $(this).children('.dropdown-menu').stop().fadeToggle().toggleClass('fadeOutUpSmall'); $(this).children('.dropdown-menu').addClass('animated-fast').removeClass('fadeInDownSmall'); }); }); var headnew = $(window).scrollTop(); function header_scroll(){ var scrollTop = $(document).scrollTop(); if(scrollTop<=0){ scrollTop=0; } if(scrollTop > headnew){ $(".header_fixed").addClass("header_hide"); }else if(scrollTop<=0){ $(".header_fixed").removeClass("white"); }else{ $(".header_fixed").removeClass("header_hide"); $(".header_fixed").addClass("white"); } headnew = scrollTop; } $(window).scroll(function () { // header_scroll(); }); $(window).on('load',function () { // header_scroll(); if($(window).scrollTop()>0){ $(".header_fixed").addClass("white"); } }); $(function(){ $(".qiehuan").each(function(index, element) { $(".qiehuan_tit",this).hover(function(){ var qiehuan_title_index = $(".qiehuan_tit",".qiehuan:eq("+index+")").index(this); $(this).addClass("hover").siblings(".qiehuan_tit").removeClass("hover"); $(".qiehuan_box:eq("+qiehuan_title_index+")",".qiehuan:eq("+index+")").addClass("hover").siblings(".qiehuan_box").removeClass("hover"); }); }); $('.open_search').click(function(){ if($('.search_box').hasClass('on')){ $('.search_box').removeClass('on'); }else{ $('.search_box').addClass('on'); } }); $('.search_close').click(function(){ $('.search_box').removeClass('on'); }); $('.open_menu').click(function(){ if($('.main_menu_box').hasClass('on')){ $('.main_menu_box').removeClass('on'); $('body').removeClass('no_scroll'); }else{ $('.main_menu_box').addClass('on'); $('body').addClass('no_scroll'); } }); $('.menu_close').click(function(){ $('.main_menu_box').removeClass('on'); $('body').removeClass('no_scroll'); }); $(".search-form").each(function(index){ //搜索功能 $('.btn-submit',this).click(function(){ var url = $(this).attr('url'); var query = $(".search-form:eq("+index+")").find('input').serialize(); query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,''); query = query.replace(/^&/g,''); if( url.indexOf('?')>0 ){ url += '&' + query; }else{ url += '?' + query; } window.location.href = url; }); //回车自动提交 $(this).find('input').keyup(function(event){ if(event.keyCode===13){ $(".search-form:eq("+index+")").find(".btn-submit").click(); } }); }); $(".gotop").click(function(){ $("html").animate({scrollTop:0},400+$(window).scrollTop()*0.3); if(navigator.appVersion.match("WebKit")){ $("body").animate({scrollTop:0},400+$(window).scrollTop()*0.3); }else{ $("html").animate({scrollTop:0},400+$(window).scrollTop()*0.3); } }); }); function getCurDate(){ var d = new Date(); var week; switch (d.getDay()){ case 1: week="星期一"; break; case 2: week="星期二"; break; case 3: week="星期三"; break; case 4: week="星期四"; break; case 5: week="星期五"; break; case 6: week="星期六"; break; default: week="星期天"; } var years = d.getFullYear(); var month = d.getMonth()+1; var days = d.getDate(); var hours = add_zero(d.getHours()); var minutes = add_zero(d.getMinutes()); var seconds=add_zero(d.getSeconds()); var ndate = years+"年"+month+"月"+days+"日 "+week+" "+hours+":"+minutes+":"+seconds; $('.top .date').html(ndate); } function add_zero(temp){ if(temp<10) return "0"+temp; else return temp; } // setInterval(getCurDate,100); $(window).on('load',function () { var wow = new WOW({ boxClass: 'wow', animateClass: 'animated', offset: 0, mobile: true, live: true }); wow.init(); });