iframe获取焦点的问题、获取iframe src、打开新窗口window.open()
来源:互联网 发布:origin软件怎么安装 编辑:程序博客网 时间:2024/06/05 04:41
<iframe id="embed" frameborder="no" name="abc" border="0" src="www.lingpic.com" style="width:100%; color:#000;" mozallowfullscreen webkitallowfullscreen allowfullscreen></iframe>
1、先获取iframe再加focus()函数
document.getElementById('embed').focus();
2、在iframe框架里面点击元素让iframe获取焦点
如果www.lingpic.com里面有个<div id="box"></div> 的元素 那我们点击box让iframe获取焦点。例:
document.getElementById('box').onclick = function(){
var aFrame = parent.frames; //获取frames 是个类似数组
aFrame[0].focus();
}
3、在iframe里获取iframe的src
document.getElementById('box').onclick = function(){
var aFrame = parent.frames; //获取frames 是个类似数组
var src = aFrame[0].location.href;
//打开新窗口
window.open (src, 'newwindow', 'height=700, width=1000, top=50,left=100, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no')
}
打开新窗口 newwindow名称只有不同的时候才能打开多个新窗口
- iframe获取焦点的问题、获取iframe src、打开新窗口window.open()
- 使用target打开的iframe 获取src的问题
- iframe/window.open打开一个新窗口/子窗口中调用父窗口的方法
- 获取iframe的window对象
- 获取iframe的Window对象
- 获取iframe中window对象的方法
- ie和ff下<a>更新<iframe>的src导致打开新选项卡或者新窗口
- javascript window获取iframe、iframe获取window、document
- JavaScript获取iframe里面的src路径里面的内容
- jquery获取,更改iframe的src的值
- 获取iframe中src页中的对象
- Ie 8 的window.open打开新窗口无反应问题。
- 在引用iframe后,子页面获取父页面iframe的src
- window.open打开新窗口
- 打开新窗口(window.open)
- 打开新窗口window.open
- 获取iframe的url
- 关于获取iframe高度不准的问题
- Android 中关于 【Cursor】 类的介绍
- 黑马程序员--数组
- Java 内存分配
- NSString 常用处理方法
- git clone 时,出现result=18,HTTP code=200,
- iframe获取焦点的问题、获取iframe src、打开新窗口window.open()
- 退出帐号时handler消息循环造成闪退的问题
- java环境
- 查看Linux并发连接数
- 3Sum Closest
- 用图片实现form表单的提交按钮
- 函数指针及其的运用(上)——何为函数指针
- Gulp 自动化的项目构建工具
- leetcode Valid Palindrome