鹰翔宇空

学习和生活

BlogJava 首页 新随笔 联系 聚合 管理
  110 Posts :: 141 Stories :: 315 Comments :: 1 Trackbacks

下面的是左右框架可以动态拉动的源代码
<html>
  <head>
    <title>scollingConsole</title>
    <script language="javascript">


function bringToTop() {
    if( self != top ) {
      top.location.href = self.location.href;
    }
}

    </script>

  </head>

  <frameset onload='javascript:bringToTop();' cols='240,*' frameborder=yes frameborder=5 name='TrampEagle'>
   
    <frame src='' name='hyq' scrolling='no' marginheight='0' marginwidth='0' >

    <frame src='' name='312' marginheight='0' marginwidth='0'>
  
  </frameset>

  <noframes>
    <body bgcolor=white text='#666666'>

      <center><H3>Please use a frames-capable browser</H3></center>
    </body>
  </noframes>

</html>


 其实很简单的,但是以前总以为很神秘,以为要搞很多代码去实现这个功能。如果不希望拉动,也很简单,就是在frame 属性后再加一个NORESIZE就可以了,如:<frame src='' name='hyq' scrolling='no' marginheight='0' marginwidth='0' NORESIZE >,三个框架的和这个同理,事例如下:

<html>
  <head>
    <title>scollingConsole</title>
    <script language="javascript">


function bringToTop() {
    if( self != top ) {
      top.location.href = self.location.href;
    }
}

    </script>

  </head>
<FRAMESET ROWS="150,*">
 <FRAME NAME="Frame1" FRAMEBORDER=1 SCROLLING="Yes" NORESIZE>
 <FRAMESET onload='javascript:bringToTop();' COLS="240,*">
  <FRAME scrolling='no' marginheight='0' marginwidth='0'>
  <FRAME name='312' marginheight='0' marginwidth='0'>
 </FRAMESET>
</FRAMESET>

  <noframes>
    <body bgcolor=white text='#666666'>

      <center><H3>Please use a frames-capable browser</H3></center>
    </body>
  </noframes>

</html>


 

posted on 2006-04-22 15:21 TrampEagle 阅读(727) 评论(0)  编辑  收藏 所属分类: 学习体会

只有注册用户登录后才能发表评论。


网站导航: