开发者

How t make a href="#top" from iframe to parent window

开发者 https://www.devze.com 2022-12-20 16:01 出处:网络
I using parent window andone iframe my html code is given below Page1.html <html> <head> <meta http-equiv=\"Content-Language\" content=\"en-us\">

I using parent window and one iframe my html code is given below

Page1.html

    <html>
    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>New Page 1</title>
    </head>
    <body>

    <a name="logo"  href="Page2.html">dsd</a><br/>
ttttttbr/>
rrrrr<br/>
rrrrr<br/>
rrrrr<br/>
rrrrr<br/>
rrrrr<br/>
rrrrr<br/>
<iframe name="I1" src="Page3.html">Your browser does not support inline frames or is currently configured not to display inline frames.
    </开发者_运维知识库iframe>

    </body>

    </html>

Page3.html

<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>

<a href="Page2.html?#logo">dsd</a><br/>
</body>

</html>

If i click the link in side iframe, open the page2.html in side iframe and move to the top of the page of parent window together.

How i can do this ?

hoping ur support

Alex


I think this can't be done using pure HTML. You would need JavaScript for that, something like this:

<a href="Page2.html" onclick="parent.location.href='#'">
0

精彩评论

暂无评论...
验证码 换一张
取 消