我已经在我的代码中使用了这些东西,但没有一个能够正常工作。诚恳建议我使用任何其他方式解决此问题。css()不设置body标签的背景属性
// #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");
}
这是什么意思'$ {actionBean.backgroundImage}'。这是一个'选择器' – shu
你的逻辑是有缺陷的; ''$ {actionBean.backgroundImage}“!= null'将永远不会成为'false',即使值是''''。 –
$ {actionBean.backgroundImage} ... 它是一个Stripes变量....并且条件在这里不是假的... 我正在使用Stripes Framework ... –