$(document).ready(function () { clickleftNav(); }); function clickleftNav() { $('.left-nav > div:nth-child(1)').addClass('active') $('.left-nav > div').click(function(){ $(this).addClass('active') $(this).siblings().removeClass("active"); }) } // $(window).scroll( function (){ // let topScroll = $('.main').offset().top - $(window).scrollTop(); // if(topScroll <= 0){ // $('.sider').addClass('lock'); // if(document.body.clientWidth < 767){ // $('.se').hide(); // $('.pro').hide(); // } // }else{ // $('.sider').removeClass('lock'); // if(document.body.clientWidth < 767){ // $('.se').show(); // $('.pro').show(); // } // } // }); $('#se').bind('keydown',function(event){ if(event.keyCode == "13") { var kw = $.trim($('#se').val()); if(kw!=''){ window.location.href = "/product/search/"+kw+".html"; } } }); $('#se_news').bind('keydown',function(event){ if(event.keyCode == "13") { var kw = $.trim($('#se_news').val()); if(kw!=''){ window.location.href = "/news/search/"+kw+".html"; } } });