<head> <script type="text/javascript"> function changeurl() { parent.upperframe.location.href="frame_b.htm" parent.lowerframe.location.href="frame_c.htm" } </script> </head> <body>
<form> <input type="button" onclick="changeurl()" value="Change url"> </form> <p>Right-click inside the two frames and select "View Source" to see the source code.</p> </body>
</html>
更新2个以上的页面
<html> <frameset cols="70%,*" frameborder="1"> <frame src="frames_sourcepage2.htm"> <frameset rows="30%,*" frameborder="1"> <frame name="uframe" src="frame_a.htm"> <frame name="lframe" src="frame_b.htm"> </frameset> </frameset> </html>
<html> <head> <script type="text/javascript"> function changeurl() { parent.uframe.location.href="frame_c.htm" parent.lframe.location.href="frame_d.htm" } </script> </head>
<body> <form> <input type="button" value="Change url" onclick="changeurl()"> </form> <p>Right-click inside the three frames and select "View Source" to see the source code.</p> </body>
</html>
更新两个IFRAME
<html> <head> <script type="text/javascript"> function twoframes() { document.all("frame1").src="frame_c.htm" document.all("frame2").src="frame_d.htm" } </script> </head>
<body> <iframe src="frame_a.htm" name="frame1"></iframe> <iframe src="frame_b.htm" name="frame2"></iframe> <br /> <form> <input type="button" onclick="twoframes()" value="Change url of the two iframes"> </form> </body>
</html>
图象对象
改变图象的高度
<html> <head> <script type="text/javascript"> function setHeight() { var x=document.images x[0].height="250" } </script> </head>
<body> <img src="http://www.webjx.com/htmldata/sort/compman.gif" width="107" height="98" /> <form> <input type="button" onclick="setHeight()" value="Change height of image"> </form> </body>
</html>
改变图象
<html>
复制本页网址和标题,发送给你QQ/Msn的好友一起分享
上一篇:网页制作中表单相关特效整理
下一篇:javascript的键盘控制事件