gpt4 book ai didi

javascript - 在 Shopify 中将 CSS 添加到 iframe

转载 作者:行者123 更新时间:2023-11-28 04:13:46 24 4
gpt4 key购买 nike

我正在将CSS添加到shopify中的iframe中。但它不工作..这是我的代码。

<script>
$('#twitter-widget-0').load(function() {
var css = '<style type="text/css"> body {background: white};</style>';
$('#twitter-widget-0').contents().find("head").append(css);
});
</script>

最佳答案

使用下面的代码。如果你的 DOM 是正确的。

<script>
$('#twitter-widget-0').load(function() {
var css = '<style type="text/css"> body {background: white}</style>';
$('#twitter-widget-0').contents().find("head").append(css);
});
</script>

关于javascript - 在 Shopify 中将 CSS 添加到 iframe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46049758/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com