Two frames one scrollbar

两盒软妹~` 提交于 2019-11-29 12:22:19

When using frames, each will get its own scroll bars.

You can't have a single scroll bar for two frames, precisely because the are two frames.


Update:

You can workaround this by making both frames non scrolling and wrapping both them within a third scrolling frame (whose only reason to exist is to provide a single scroll bar). The parent frame will handle scrolling of both inner frames together.

You need to add a new page with a frameset like the following, making sure the second one points to your frameset (and set SCROLLING="NO" on both framesets:

<FRAMESET ROWS="0%,100%"
  BORDER="0"
  FRAMEBORDER="NO">
  <FRAME SRC=""
    NAME="dummy"
    FRAMEBORDER="NO"
    MARGINHEIGHT="0"
    MARGINWIDTH="0"
    NORESIZE
    SCROLLING="NO">
  </FRAME>
  <FRAME SRC="*url to your frameset*"
    NAME="myframes"
    FRAMEBORDER="NO"
    MARGINHEIGHT="0"
    MARGINWIDTH="0"
    NORESIZE
    SCROLLING="YES">
  </FRAME>
</FRAMESET>

I got what you are looking for using IFRAME.

It's even more flexible than FRAME, since it doesn't require you to split the window from edge to edge, and each frame boundary doesn't need to be aligned with another one.

I used this for a webpage I just deployed and it works like a charm.

There is one drawback: the height of the principal frame must be fixed beforehands, and you need to overestimate it in order to avoid an inner scrollbar.

<BODY>
<CENTER>
  <DIV style="display:table-cell; width:800; ">
      <iframe WIDTH=800 HEIGHT=220 src="menu.html" name="topframe" frameBorder=0 SCROLLING=NO></iframe>
      <iframe WIDTH=800 HEIGHT=380 src="home.html" name="contentframe" frameBorder=0 SCROLLING=AUTO></iframe>
      <iframe WIDTH=800 HEIGHT=220 src="menu.html" name="bottomframe" frameBorder=0 SCROLLING=NO></iframe>
  </DIV>
<CENTER>
</BODY>

Links in menu.html with TARGET="contentframe" do what you want it to do.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!