javascript - 添加附加类到 Pinterest Pin It Button iframe

标签 javascript class iframe pinterest

我在使用 Pinterest Pin it 按钮时遇到问题。 Pinterest JS默认创建一个 iframe。但是 iframe 在我的页脚中创建了不需要的空间。我试图通过隐藏 iframe 来解决不需要的间距。我无法隐藏所有 iframe,因为页面上还有其他需要的内容。 iframe 中的 class 也在不断变化,所以我无法使用它。

有没有办法向动态加载的 iframe 添加额外的 classID

最佳答案

你可以这样定位它:

iframe[src^="//assets.pinterest"] {
 display: none;
}

关于javascript - 添加附加类到 Pinterest Pin It Button iframe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14887964/

相关文章:

javascript - 使用 AJAX/Javascript/jQuery 构建和重新排序多维数组

python - 为什么不调用 __instancecheck__?

jquery - 使用 jQuery 更改不同域上 iframe 的文本框值?

asp.net - 在使用母版页(包含表单中的页面)的 aspx 页面上使用 javascript?

javascript - Express-Validator 和 req.getValidationResult()

C++ 派生多态类 - 它是否包含 Base 的整个实例,包括 vptr?

javascript - 获取跨域 iFrame 内文档的高度

javascript - 在 iFrame 的父窗口中打开一个 div

javascript - 在 Svelte 中,使用 Auth.js,如何在 +server 组件中获取 session

java - 如何获取数组来引用类