怎么用iframe实现音乐播放器跳转页面播放
1、主页面代码:<iframe src="桥接页面.html" frameborder="0" scrolling="no" style="width:680px;height:300px;"></iframe>桥接页面代码:<iframe src="目标页面.html" frameborder="0" scrolling="no" style="position:absolute;top:-250px;left:-360px;width:680px;height:500px;"></iframe>

2、js中的window对象可以一层一层地嵌套。给iframe定义一个name属性。找到主页面 然后通过主页面(frame)找其他子页面(frame)//获取iframe的window对象var topWin = window.top.document.getElementById("topNav").contentWindow;//通过获取到的window对象操作HTML元素,这和普通页面一样topWin.frames[1].document.getElementById("atag").target = "_blank";

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
阅读量:100
阅读量:151
阅读量:47
阅读量:158
阅读量:32