我已經在我的代碼中使用了這些東西,但沒有一個能夠正常工作。誠懇建議我使用任何其他方式解決此問題。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 ... –