JavaScript
发布日期:2021-06-24 07:07:08 浏览次数:4 分类:技术文章

本文共 955 字,大约阅读时间需要 3 分钟。

<!DOCTYPE html>

<html>
    <head>
        <meta charset="utf-8" />
        <title>窗口与框架</title>
        <script type="text/javascript">
            window.οnlοad=iniall;
                 function iniall(){
                     for(var i=0;i<document.links.length;i++){
                         document.links[i].οnclick=setcotant;
                         document.links[i].thisPage=i+1;
                     }
                 }
                 function setcotant(){
                     var newtext="<h1>you are now....."+this.thisPage+"<\h1>"
                     document.getElementById("icotant").contentWindow
                             .document.body.innerHTML=newtext;
                     return false;
                 }
        </script>
        <style type="text/css">
            body{
                background-color: #fff;
                height: 2000px;
            }
            iframe#icotant{
                position: fixed;
                border: 2px solid black;
                width: 400px;
                height: 400px;
                margin:200px;
            }
        </style>
    </head>
    <body>
        <iframe src="new_file104.html" name="icotant" id="icotant" > </iframe>
        <h1>A realy important page </h1>
        <h3>
        <a href="new_file105d.html">link1</a><br />
        <a href="new_file104.html">link2</a><br />
        <a href="new_file105d.html">link3</a>
        </h3>
    </body>
</html>

转载于:https://www.cnblogs.com/webph/p/5107632.html

转载地址:https://blog.csdn.net/weixin_30896763/article/details/99501744 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:iflab隔壁ios组新生面试题
下一篇:西电大第十六届程序设计竞赛 A-GRE

发表评论

最新留言

感谢大佬
[***.8.128.20]2024年04月16日 00时59分51秒