1
我想改變jQuery-ui對話框覆蓋圖像與對話框內的按鈕單擊,但在下面的代碼覆蓋圖像不會更改。我需要在click事件中動態地編輯疊加層的CSS。更改按鈕點擊jQuery覆蓋圖像
$("document").ready(function(){
var divCustom = '<div id="myOverlay">
<div id="button1">button1</div>
<div id="button2">button2</div>
</div>';
$(divCustom).dialog({ height: 400, width: 700, modal: true });
$("#button1").click(function(){
$("#myOverlay .ui-widget-overlay").css({
"background-image": "happy.gif"
});
});
$("#button2").click(function(){
$("#myOverlay .ui-widget-overlay").css({
"background-image": "sad.gif"
});
});
});
究竟「不工作」是什麼意思?另外,請清理你的代碼示例的格式。 – j08691
重疊圖像不會更改 –
您是否收到任何錯誤?當您使用控制檯進行調試時,您會看到什麼? – j08691