我在使用 Pinterest Pin it 按钮时遇到问题。 Pinterest JS默认创建一个 iframe
。但是 iframe
在我的页脚中创建了不需要的空间。我试图通过隐藏 iframe
来解决不需要的间距。我无法隐藏所有 iframe
,因为页面上还有其他需要的内容。 iframe
中的 class
也在不断变化,所以我无法使用它。
有没有办法向动态加载的 iframe
添加额外的 class
或 ID
?
最佳答案
你可以这样定位它:
iframe[src^="//assets.pinterest"] {
display: none;
}
关于javascript - 添加附加类到 Pinterest Pin It Button iframe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14887964/