iframe

子窗口调节父窗口样式:

$(window.parent.document).find("body").attr("style","background-color:#99FF00")

父元素改子元素样式(不跨域):

document.getElementById('iframeID').contentWindow.document.body.style.backgroundColor="#f00";

例如:

var topWindow=$(window.parent.document);

var iframe_box=topWindow.find("#iframe_box");//获取Iframe
iframe_box.find(".show_iframe").hide()

从多个iframe中查找元素

var topWindow = $(window.parent.document);
var $iframe = topWindow.find('#moreQuotes .moreStock_iframe');         
$iframe.contents().find('input.sunPageSearch').siblings('ul').css('display', 'none');

 

相关文章:

  • 2022-01-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-14
  • 2021-09-30
  • 2021-11-06
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2020-07-22
相关资源
相似解决方案