码迷,mamicode.com
首页 > 其他好文 > 详细

Frameset 两页面互调控件技术案例

时间:2014-11-13 18:02:27      阅读:164      评论:0      收藏:0      [点我收藏+]

标签:style   blog   io   color   ar   sp   div   on   log   

总共包含三个页面(Html),分别为Parent.Html、ChildA.Html、ChildB.Html

Parent.Html页面代码

<frameset cols="50%,*"> 
    <frame name="left" src="1.html"> 
    <frame name="right" src="2.html"> 
</frameset>

ChildA.Html页面代码

<html>
<head>
    <script>
        function setValue() {
          window.parent.document.getElementById("right").contentWindow.document.getElementById("txt2").value = document.getElementById("txt1").value;
        }
    </script>
</head>
<body>
    <input type="text" id="txt1" onkeyup="setValue()" />
</body>
</html>

ChildB.Html页面代码

<html>
<head>
    <script>
        function setValue() {
           window.parent.document.getElementById("left").contentWindow.document.getElementById("txt1").value = document.getElementById("txt2").value;
        }
    </script>
</head>
<body>
    <input type="text" id="txt2" onkeyup="setValue()" />
</body>
</html>

 

Frameset 两页面互调控件技术案例

标签:style   blog   io   color   ar   sp   div   on   log   

原文地址:http://www.cnblogs.com/xiaocaibaodao/p/4095257.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!