Home >Web Front-end >HTML Tutorial >iframe page jump problem_html/css_WEB-ITnose
The java framework
has three pages: aaa.jsp, bbb,jsp, ccc.jsp<script type="text/javascript"> function showDeatil(obj,url){ $("downMain").src=url; }</script><body onload=""> <!--这是主页面aaa.jsp --> <div style="width: 100%; height: 10%; float: left;"> <a id="sfcurrent1" href="#" target="downMain" onclick="showDeatil('1','bbb.jsp');">点击链接在下面的iframe中显示子页面</a> </div> <div style="overflow: visible; width: 100%; height: 90%; float: left; border-style: outset; border: 0px;"> <iframe style="border: 0px;" width="100%;" height="100%" frameborder="1" id="downMain" name="rightMain" src=""></iframe> </div></body>
<script type="text/javascript"> function showDeatil1(obj,url){ $("rightMain").src=url; }</script><body onload=""> <!--这是第二个子页面bbb.jsp --> <div style="width: 3%; height: 100%; float: left;"> <a id="sfcurrent1" href="#" target="rightMain" onclick="showDeatil1('1','ccc.jsp');">点击链接在右边的iframe中显示第三个页面</a> </div> <div style="overflow: visible; width: 96%; height: 100%; float: left; border-style: outset; border: 0px;"> <iframe style="border: 0px;" width="100%;" height="100%" frameborder="1" id="rightMain" name="rightMain" src=""></iframe> </div></body>
function showDeatil(obj,url ){
$("#downMain").get(0).src=url;
}
function showDeatil1(obj,url){
$("#rightMain") .get(0).src=url;
}
Is $ the $ of jquery?
Correct the error and remove the target, try
function showDeatil(obj,url){
$("#downMain").get(0).src=url;
}
function showDeatil1(obj,url){
$("#rightMain").get(0).src=url;
}
$ is the $ of jquery?
Correct the error, then remove the target, try
$ is document.getElementById("downMain")
Now there are two situations:
When there is no target, the bbb page will refresh to cover the entire window, that is to say, in the window, the bbb page and the ccc page in the Bbb frame
are displayed. When there is a target, 3 pages can be displayed normally in one window, but a new window is opened to display bbb and ccc page
c76a95286649e8d9c7f51f69c7517d4a065276f04003e4622c4fe6b64f465b88
It turns out that I set the height of the iframe to 200%, and the iframe filled the window