//位置监听 $(document).ready(function() { $('#ly').waypoint(function() { _top_flag = $('#top_flag').val(); if(_top_flag == ''){ $('#header').addclass('headerb'); $('#top_flag').val('1'); }else{ $('#header').removeclass('headerb'); $('#top_flag').val(''); } }, { offset: '10px' }); $('.subbg').waypoint(function() { _top_flag2 = $('#top_flag2').val(); if(_top_flag2 == ''){ $('.viewnav').addclass('viewnavfix'); $('#top_flag2').val('1'); }else{ $('.viewnav').removeclass('viewnavfix'); $('#top_flag2').val(''); } }, { offset: '0px' }); }); $('.sendemail').click(function() { $('html,body').animate({ scrolltop:$('#texing').offset().top-150 },500) }); $(function(){ //微信弹出 $(".kefu li").hover(function() { $(this).children('.kfcon').slidedown(200); }, function() { $(this).children('.kfcon').slideup(200); }); //返回顶部 $(".kftop").click(function(){ if ($('html').scrolltop()) { $('html').animate({ scrolltop: 0 }, 1000); return false; } $('body').animate({ scrolltop: 0 }, 1000); return false; }); }) //nav $('.navt li').hover(function(){ $(this).find('dl').show(); },function(){ $(this).find('dl').hide(); }); $('.navt li dl dd').hover(function(){ $(this).find('.navth').show(); },function(){ $(this).find('.navth').hide(); }) // $(document).ready(function() { // $('#ly').waypoint(function() { // _top_flag = $('#top_flag').val(); // if(_top_flag == ''){ // $('.header').css('position','fixed'); // $('.header').css('box-shadow','0 0 10px #888888'); // $('.top_').css('height','0'); // $('.top_').css('border','none'); // $('.logo img').css('height','70px'); // $('.nav').css('margin-top','10px'); // $('#top_flag').val('1'); // }else{ // $('.header').css('position','relative'); // $('.header').css('box-shadow','0 0 0 #888888'); // $('.top_').css('height','30px'); // $('.top_').css('border-bottom','1px #e9e9e9 solid'); // $('.logo img').css('height','100px'); // $('.nav').css('margin-top','30px'); // $('#top_flag').val(''); // } // }, { // offset: '180px' // }); // }); //子页左侧折叠 $('.s_cur').parent().parent().addclass('cur'); // $('.leftnav>dd>a').on('click',function(e){ // if($(this).siblings('.smallnav').children('a').length>0){ // e.preventdefault(); // if($(this).siblings('.smallnav').css('display')=='none'){ // $(this).parents('dd').addclass('cur'); // $(this).siblings('.smallnav').slidedown(200); // }else{ // $(this).parents('dd').removeclass('cur'); // } // } // });