【发布时间】:2016-02-26 09:23:35
【问题描述】:
我在我的代码中使用了这些东西,但它们都不起作用..请建议我解决此问题的任何其他方法。
// #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}。这是selector -
你的逻辑有缺陷;
"${actionBean.backgroundImage}" != null永远不会是false,即使值是''。 -
${actionBean.backgroundImage} ...它是一个Stripes变量...并且这里的条件不是假的...我正在使用Stripes Framework...
标签: javascript java jquery html css