利用JS在asp.net中实现左导航页的隐藏
点击次数:30 次 发布日期:2008-11-26 14:07:39 作者:源代码网
|
源代码网推荐 作者:DotSharp 源代码网推荐 源代码网推荐 我们在CSDN论坛上的左上角能够看到导航栏的功能,下面就模拟该功能,利用JS在asp.net中作一个简单的无刷新的左导航栏隐藏功能. 源代码网推荐 源代码网推荐 首先,作一个框架页,我们取名 main.aspx 源代码网推荐 <!-- main.aspx 主要代码 --> 源代码网推荐 <script> 源代码网推荐 document.write("<frameset rows="54,28,*,19" frameborder="NO" border="0" framespacing="0">"); 源代码网推荐 document.write("<frame src="http://www.zzchn.com/edu/20080727/title.aspx" name="topFrame" scrolling="NO" noresize>"); 源代码网推荐 document.write("<frame src="http://www.zzchn.com/edu/20080727/bar.aspx" name="MainNaviFrame" scrolling="NO">"); 源代码网推荐 <!-- http://www.zzchn.com/edu/20080727/left.aspx是导航页 ,http://www.zzchn.com/edu/20080727/menuswitch.aspx是交互的按钮页 --> 源代码网推荐 document.write("<frameset name="forum" cols="150,8,*" frameborder="NO" border="0" framespacing="0">"); 源代码网推荐 document.write("<frame src="http://www.zzchn.com/edu/20080727/left.aspx" name="LeftFrame" scrolling="auto">"); 源代码网推荐 document.write("<frame src="http://www.zzchn.com/edu/20080727/menuswitch.aspx" name="SwichFrame" scrolling="No">"); 源代码网推荐 源代码网推荐 document.write("<frameset rows="100%,*" frameborder="NO" border="0" framespacing="0">"); 源代码网推荐 document.write("<frame src="" name="MainFrame" scrolling="no">"); 源代码网推荐 document.write("</frameset></frameset>"); 源代码网推荐 document.write("<frame src="http://www.zzchn.com/edu/20080727/bottom.aspx" name="BottomFrame" scrolling="No"></frameset>"); 源代码网推荐 </script> 源代码网推荐 源代码网推荐 <!-- menuswitch.js 主要代码--> 源代码网推荐 var leftwin = true; 源代码网推荐 源代码网推荐 function changeWin() 源代码网推荐 { 源代码网推荐 if(leftwin == true) 源代码网推荐 { 源代码网推荐 parent.forum.cols = "0,8,*"; 源代码网推荐 parent.SwichFrame.menuSwitch.innerHTML = "<a onclick="changeWin();" style="cursor:hand;"><img src="http://www.zzchn.com/edu/20080727/images/ArrowOpen.gif" border="0"></a>"; 源代码网推荐 leftwin = false; 源代码网推荐 } 源代码网推荐 else 源代码网推荐 { 源代码网推荐 parent.forum.cols = "150,8,*"; 源代码网推荐 parent.SwichFrame.menuSwitch.innerHTML = "<a onclick="changeWin();" style="cursor:hand;"><img src="http://www.zzchn.com/edu/20080727/images/ArrowClose.gif" border="0"></a>"; 源代码网推荐 leftwin = true; 源代码网推荐 } 源代码网推荐 } 源代码网推荐 源代码网推荐 <!-- http://www.zzchn.com/edu/20080727/menuswitch.aspx 主要代码 --> 源代码网推荐 <table height="100%" cellSpacing="0" cellPadding="0" width="8" background="images/MiddleBg1.gif" 源代码网推荐 border="0"> 源代码网推荐 <tr> 源代码网推荐 <td onclick="changeWin();" style="cursor:hand;" id="menuSwitch" align="center"> 源代码网推荐 <img id="Image1" src="http://www.zzchn.com/edu/20080727/images/ArrowClose.gif" border="0" /> 源代码网推荐 </td> 源代码网推荐 </tr> 源代码网推荐 </table> 源代码网推荐 源代码网推荐 以上功能并不完善,只能起到抛砖引玉的作用,欢迎网友与我交流. 源代码网推荐 源代码网推荐 源代码网推荐 源代码网推荐 做人要厚道,请注明转自酷网动力(www.ASPCOOL.COM)。 源代码网推荐 源代码网供稿. |
