我有一些 Javascript 在 Ajax 发布后触发。
When the javascript fires I want the
<section class="section-1653">
to be given a different background image to the one specified in the CSS file.
我正在运行以下代码,我可以看到正在设置字体大小,但背景图像没有设置。
Why is the background image property not being set?
$("section.section-1653").css({"background-image": backgroundImageUrl,font-size": "200%"});
最佳答案
图片需要在url()内
$("section.section-1653").css({"background-image": "url("+backgroundImageUrl+")", "font-size": "200%"});
关于javascript - Jquery.css 不应用背景图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35071786/