/** * */ $(document).ready(function() { // 左侧二级菜单绑定单击事件 $("#menulist ul li").on("click", function(){ var _this = $(this); $("li").removeclass("select"); _this.addclass("select"); if( _this.attr("href") != null && _this.attr("href") != "/" ){ $("#contentiframe").attr("src", _this.attr("href")); }else{ $("#contentiframe").attr("src", ""); } _this.siblings().mouseover().mouseout(); }); if(srcchannelid == null || srcchannelid == undefined || srcchannelid == ""){ $("#menulist ul li a:first").click(); // 默认点击第一个菜单 }else{ if(srcchannelid == 26 || srcchannelid == 23){ $("#contentiframe").attr("src", ctx + "/content?channelid=" + srcchannelid); }else if(srcchannelid == 28){ $("#contentiframe").attr("src", ctx + "/three?channelid=" + srcchannelid + "&channelname=下载中心"); }else if(srcchannelid == 16){ $("#contentiframe").attr("src", ctx + "/channellist?parentid=" + srcchannelid); }else{ $("#contentiframe").attr("src", ctx + "/contentlist?channelid=" + srcchannelid); } } $("#menulist2 ul li").on("click", function(){ var _this = $(this); $("li").removeclass("select2"); _this.addclass("select2"); if( _this.attr("href") != null && _this.attr("href") != "/" ){ $("#contentiframe2").attr("src", _this.attr("href")); }else{ $("#contentiframe2").attr("src", ""); } _this.siblings().mouseover().mouseout(); }); if(srcchannelid == null || srcchannelid == undefined || srcchannelid == ""){ $("#menulist2 ul li a:first").click(); // 默认点击第一个菜单 }else{ if(srcchannelid==28){ $("#contentiframe2").attr("src", ctx + "/contentlist?channelid=28&channelname=下载中心"); }else if(srcchannelid == 16){ $("#contentiframe").attr("src", ctx + "/channellist?parentid=" + srcchannelid); }else{ $("#contentiframe2").attr("src", ctx + "/contentlist?channelid=" + srcchannelid); } } }) function changeframeheight(){ settimeout(function(){ var iframe = document.getelementbyid("contentiframe"); if(document.body.offsetheight < 800){ iframe.height = 800; }else{ iframe.height = iframe.contentwindow.document.body.offsetheight+100; } }, 500); } function changeframeheight2(){ settimeout(function(){ var iframe = document.getelementbyid("contentiframe2"); if(document.body.offsetheight < 800){ iframe.height = 800; }else{ iframe.height = iframe.contentwindow.document.body.offsetheight+100; } }, 100); } function changeframeheight3(){ settimeout(function(){ var iframe = document.getelementbyid("contentiframe3"); if(document.body.offsetheight < 800){ iframe.height = 800; }else{ iframe.height = iframe.contentwindow.document.body.offsetheight+100; } }, 100); } function search(){ var keyword = document.getelementbyid("keyword").value; if(keyword == null || keyword == ''){ alert("请输入搜索关键词"); return; }else{ window.open(ctx+"/pagelist?channelid=41&content="+keyword); } } function searchkey(e) { var evt = window.event || e; if (evt.keycode == 13) { var keyword = document.getelementbyid("keyword").value; if(keyword == null || keyword == ''){ alert("请输入搜索关键词"); return; }else{ window.open(ctx+"/pagelist?channelid=41&content="+keyword); } } }