美文网首页
jquery操作Iframe

jquery操作Iframe

作者: 前端大鹏 | 来源:发表于2017-08-08 16:26 被阅读0次

父页面操作子页面


$("#iframe").load(function(){

var iframH = $(this).contents().find("html").outerHeight(true);

$(this).css("height", iframH+"px");

console.log(iframH);

});

子页面操作父页面


获取的简易写法

$("子集", "父级");

iframe里面内容操作父级

$(".header_title", window.parent.document).text();

等价于

$(window.parent.document).find(".header_title").text();

动态刷新Iframe


原生js写法:

document.getElementById('FrameID').contentWindow.location.reload(true);

jquery写法:

$('#iframe').attr('src',$('#iframe').attr('src'));

相关文章

  • jquery操作Iframe

    父页面操作子页面 $("#iframe").load(function(){ var iframH = $(thi...

  • js代码段

    js代码记录 jquery子页面(iframe)操作 父页面中的 iframe元素 js判断是否是数字 js判断邮...

  • jquey操作Iframe

    记录jquery操作iframe 子窗口调用父窗口中的方法 子窗口触发父窗口中的事件 父窗口中查找子窗口中的元素

  • 五、jQuery操作css、位置属性和尺寸属性

    jQuery操作css属性jQuery操作位置属性jQuery操作尺寸属性 1. jQuery操作css属性 逐个...

  • PEDIT 常用事件

    在iframe中常用操作 为当前操作控件赋值 获取当前操作控件的值 关闭当前iframe 关闭当前模块操作界面 模...

  • 03.jQuery html

    jQuery文档操作 jQuery属性操作 jQuery css操作 image.png

  • iframe父页面、子页面元素操作

    下列方法在不跨域的基础上使用: 简单使用jquery来操作iframe的方法记录,也可以使用纯js也可以实现。 j...

  • jQuery操作 及动画效果

    jQuery样式操作 click事件 jQuery索引值 jQuery做选项卡 jQuery属性操作 jQuery...

  • jQuery操作 及动画效果

    jQuery样式操作 click事件 jQuery索引值 jQuery做选项卡 jQuery属性操作 jQuery...

  • jQuery操作 及动画效果

    jQuery样式操作 click事件 jQuery索引值 jQuery做选项卡 jQuery属性操作 jQuery...

网友评论

      本文标题:jquery操作Iframe

      本文链接:https://www.haomeiwen.com/subject/uzntrxtx.html