网站建设中颜色的感染力,梧州网站开发,郑州东区网站优化公司推荐,河南省建设安全监督总站网站首先是原版三层框架的html#xff1a;
html
head
titleTHPWP/title
/head !-- 切记frameset不能写在body里面#xff0c;以下代表首页由三层模块组成#xff0c;其中第一层我是用来放菜单高度占比14%#xff0c;中间的用作主…首先是原版三层框架的html
html
head
titleTHPWP/title
/head !-- 切记frameset不能写在body里面以下代表首页由三层模块组成其中第一层我是用来放菜单高度占比14%中间的用作主体高度占比70%剩下的底部用于放置友情链接等等占比16% --frameset rows14%,70%,16% cols* frameborderNO framespacing0frame srctitle.jsp nametopFrame scrollingNO noresize /frame srcmain.jsp namemainFrame scrollingYes noresize/ frame srclink.jsp namefoot scrollingNO noresize/ /frameset
/html
变更div后
html
head
title测试替换frame/title
style typetext/css*{margin: 0;padding: 0;}td{text-align: center;}body{text-align:center;background-color:#edf7fd;}td{text-align: center;}.cursorPointer td:hover { background-color:#e6ff90; cursor: pointer; color: red; } a{color: #0066FF;}td a:link {text-decoration: none;color: #00527f;font-size: 10px;font-family: Arial,Helvetica,sans-serif;}
/style
scriptfunction ajaxtoxx(ur){/*ajaxtoxx方法是用来替代a标签跳转到其中一个frame例如之前页面的a hrefxxx targetmainFrame XXX/a当点击时会在frame名为mainFrame的层中显示返回的页面但替换frame为div之后就需要使用load方法进行加载了无论是springMvc还是struts返回页面都可以直接使用load(api接口地址)进行加载也可以使用ajax访问接口并把返回的页面使用$(#main).html(返回值)进行加载但是有load这种简单的方法何乐而不为*/$(#main).load(ur);}
/script
/headbodydiv styleheight:12%;position: fixed;width: -webkit-fill-available; idtitletable stylewidth:100%trtdspan stylecolor: #0033FF; font-size: 46px;LOGO/span/tdtd styletext-align: center;span stylecolor: #0066FF; font-size: 40px;某某系统/span/tdtd stylecolor: black;用户名 : 管理员 br 登入时间 : 2023-04-27bra hrefpwd.do?txt_uid${LoginForm.txt_uid}newpwdupdPwd targetmainFramestrong修改密码/strong/a/td/trtrtd height30 colspan3table style width:100%;background: #bde1bd; classcursorPointertrc:if test${LoginForm.role !2} !-- 不是2即不是审核员就显示 --td width7%a hrefbaidu.comstrong stylecolor: black;主页/strong/a/tdtd width8.3% onclickajaxtoxx(https://translate.google.com.hk)XXX/a/td/c:ifc:if test${LoginForm.role !0} !-- 操作日志只有管理员与审核人员才能看 普通用户不能看 --td width8%a hrefhttps://translate.google.com.hk/ target_blank stylefont-weight: 900;color:#f57100操作日志/a/td/c:iftd width8%a hrefLogout.do target_parent stylecolor:redstrong注销/strong/a/td/tr/table/td/tr/table/divc:if test${LoginForm.role !2} !-- 不是2即不是审核员就显示 --div styleposition: absolute;top: 12%;bottom: 12%;width: -webkit-fill-available;overflow-y: auto; idmain classcursorPointer !--top与bottom都是12意思是除了菜单与链接外的空间全是main的 --主体内容/divhrdiv styleheight: 12%;position: fixed;width: -webkit-fill-available;bottom: 0px; classcursorPointer尾部/div/c:if/body
/html重点
1. 替换后最重要的就是a标签指定刷新哪个frame需要更改为$(#main).load(链接)其他倒没有什么如果不把frame改成div就会经常出现frame中某些内容重复生成或者不显示特别恶心
2.如果其他a标签点击跳转的子页面出现以下内容
script languageJavaScriptopener.parent.xxx(); //调用父窗口的方法父模块必须是frame否则无效
/script
window.opener是当前页面A通过open方法弹出一个窗口B那在B页面上 window.opener就是A window.parent是当前页面C通过location.href转到新的页面D那在D页面上window.parent就是B 或者是页面E里套一个frame为F那F页面的window.parent就是E
opener 在当前窗口创建子窗口可能需要从子窗口引用父窗口因此就有了opener的存在。
opener即谁打开我的比如A页面利用window.open弹出了B页面窗口那么A页面所在窗口就是B页面的opener在B页面通过opener对象可以访问A页面。
parent 在当前窗口中包含frame框架在一组框架集中子框架访问父框架时就需要parent来访问。
parent表示父窗口比如一个A页面利用iframe或frame调用B页面那么A页面所在窗口就是B页面的parent。
综上所述opener是负责窗口之间父子关系parent是负责框架间父子关系。