javascript css()未设置正文标记的背景属性
我在我的代码中使用了这些东西,但没有一个有效。。请建议我解决这个问题的其他方法
// #1
if ("${actionBean.backgroundImage}" != null){
$(document.body).css("pointer-events", "none");
$(document.body).css("cursor", "default");
$(document.body).css("background", "url('${actionBean.backgroundImage}') no-repeat fixed center -80px / cover !important");
}
// #2
if ("${actionBean.backgroundImage}" != null){
$('html, body').css("pointer-events", "none");
$('html, body').css("cursor", "default");
$('html, body').css("background", "url('${actionBean.backgroundImage}') no-repeat fixed center -80px / cover !important");
}
// #3
if ("${actionBean.backgroundImage}" != null){
$("body").css("pointer-events","none");
$("body").css("cursor","default");
$("body").css("background", "url('${actionBean.backgroundImage}') no-repeat fixed center -80px / cover !important");
}
// #4
if ("${actionBean.backgroundImage}" != null){
$(body).css("pointer-events", "none");
$(body).css("cursor", "default");
$(body).css("background", "url('${actionBean.backgroundImage}') no-repeat fixed center -80px / cover !important");
}
# 1 楼答案
尝试对背景使用单独的属性,例如:
这必须包括在身体下面
# 2 楼答案
你也可以通过给你的身体类别提供id来使用它。。。。并使用它添加CSS
}