【问题标题】:How to get style attribute of iframe from inside of that iframe(javascript)如何从该 iframe 内部获取 iframe 的样式属性(javascript)
【发布时间】:2020-09-23 06:03:42
【问题描述】:

我正在尝试在 iframe 元素可见时执行操作,但 iframe 具有定义了“visibiliy:hidden”的样式属性,这使 iframe 的 :is('visible') 的输出为 true,I'因此,我无法应用可见性检查。 谢谢。

【问题讨论】:

    标签: javascript iframe attributes visibility


    【解决方案1】:

    您可以使用 javascript 更改样式属性的可见性,然后执行操作。您将像这样运行代码。

    let frame = document.querySelector("iframe");
       if (frame.style.visibility = "visible") {
        // Here you can perform required action
     }
    

    【讨论】:

      猜你喜欢
      • 2021-10-14
      • 2015-09-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多