//loading //nav $(function(){ $(".cat-56").addClass("cur"); $(".cat-54").addClass("cur"); $(".cat-0").addClass("cur"); }); //search // $(document).on("click", ".btn-search", function() { if($('#q').val() == ''){ var typeid = $('#typeid').attr('data'); if(typeid!=''){ $('#typeid-'+typeid).addClass('on'); }else{ $('#typeid-0').addClass('on'); } layer.msg('请输入关键词'); $('#q').focus(); return false; }else{ var keyword = $('#q').val(); var typeid = $('#typeid').attr('data'); if(typeid && typeid != '0'){ window.location.href = 'http://www.sgcio.com/'+typeid+'/search/'+encodeURIComponent(keyword); }else{ window.location.href = 'http://www.sgcio.com/search/'+encodeURIComponent(keyword); } } }) if($.isFunction(keyDownSearch)){ }else{ document.onkeydown=keyDownSearch; function keyDownSearch(e) { var theEvent = e || window.event; var code = theEvent.keyCode || theEvent.which || theEvent.charCode; if (code == 13 && $('#q').val() != '') { if($('#q').val() == ''){ layer.msg('请输入关键词'); $('#q').focus(); return false; }else{ var keyword = $('#q').val(); var typeid = $('#typeid').attr('data'); if(typeid && typeid != '0'){ window.location.href = 'http://www.sgcio.com/'+typeid+'/search/'+encodeURIComponent(keyword); }else{ window.location.href = 'http://www.sgcio.com/search/'+encodeURIComponent(keyword); } } return false; } return true; } } //if (document.location.host != "www.sgcio.com") { //location.href = location.href.replace(document.location.host,'www.sgcio.com'); //} //feedback function suggest(e) { var userid = ''; layer.open({ type: 2, title: '建议反馈', closeBtn: 1, area: ['500px', '350px'], skin: 'layui-layer-nobg', //没有背景色 shadeClose: true, content: ['http://www.sgcio.com/index.php?m=formguide&c=index&a=show&formid=46&siteid=1&&userid='+userid+'&url='+encodeURIComponent(location.href)+'&pop=1', 'no'] }); }