关于html分帧

来源:互联网 发布:数字签名软件 编辑:程序博客网 时间:2024/06/05 20:59

页面分为3部分:上、下(左、右)。

1、想要通过点击top.html(上部)中的a链接,使同一页面内左部、右部同时实现页面的更新。

使用一个onclik属性。

例:

admin_index.html(整体框架)

<frameset rows="85px,*" border="1" bordercolor="#b5cfd9" noresize name="total"><frame src="admin_top.html" name="top" scrolling="no" /><frameset cols="159px,*" name="bottom" border="1" bordercolor="#b5cfd9"><frame src="admin_left.html" name="left" scrolling="no" /><frame src="admin_right.html" name="right" scrolling="no" /></frameset></frameset>

top.html(上部)主要内容

<ul class="chief_list"><li><a href="#" class="list" onclick="parent.left.location='./admin_left1.html';parent.right.location='./admin_right1.html'" target="top">站点信息</a></li><li><a href="#" class="list" onclick="parent.left.location='./admin_left2.html';parent.right.location='./admin_right2.html'" target="top">用户管理</a></li><li><a href="#" class="list" onclick="parent.left.location='./admin_left3.html';parent.right.location='./admin_right3.html'" target="top">版块管理</a></li><li><a href="#" class="list" onclick="parent.left.location='./admin_left4.html';parent.right.location='./admin_right4.html'" target="top">帖子管理</a></li></ul>
以上。

左右部分通过onclick实现更新,同时设置属性target='top'实现上部的更新(保持原页面)。


2、想要通过点击top.html(上部)中的a链接,实现整个框架的更新。

例:

admin_index.html(整体框架)

<frameset rows="85px,*" border="1" bordercolor="#b5cfd9" noresize name="total"><frame src="admin_top.html" name="top" scrolling="no" /><frameset cols="159px,*" name="bottom" border="1" bordercolor="#b5cfd9"><frame src="admin_left.html" name="left" scrolling="no" /><frame src="admin_right.html" name="right" scrolling="no" /></frameset></frameset>
top.html(上部)主要内容

<a href="#" onclick="parent.location='./admin.html'" >退出</a>
点击a链接,将admin.html页面(另一个页面)呈现在整个admin_index.html(整体框架)内。

以上是同一个页面(分帧框架)内跳转,同一窗口内。

通过target='total',也会实现整个框架的更新,但是会打开新的窗口。

原创粉丝点击