boss要求,把top的那个frame能伸缩,网上查了一下,发现比想象中的简单好多
代码
1.frameset
<frameset id="main" name=main rows="118,*" cols="*" frameborder="no" border="0" framespacing="0"> <frame src="${ctx }/top?provinceSign=0" scrolling="No" noresize="noresize" id=TopTitle name=TopMenu title="topFrame"/> <frame src="${ctx}/gis/scene/scene" id=MainTitle name=MainMenu title="mainFrame" scrolling="yes"/> </frameset>2.frame页面
<img id="topimg" src="static/images/top/arrow_large_up_outline.png" onClick="frame()" style="float:right;height:36px">
var flag=1; function frame(){ if(flag==2){ flag=1; parent.document.getElementById("main").rows="118,*"; $("#topimg").attr('src',"static/images/top/arrow_large_up_outline.png"); topimg.alt="隐藏主菜单" $("#headertop1").show(); } else { flag=2; $("#topimg").attr('src',"static/images/top/arrow_large_down_outline.png"); $("#topimg").attr('alt',"显示主菜单"); parent.document.getElementById("main").rows="36,*"; $("#headertop1").hide(); } }