jquery模式对话框不适用于modal:true
不知道我在这里做错了什么。 只是想让它成为一个modal dialog(使页面内容变暗)。 我认为它就像modal:true
一样简单modal:true
。 单击图像时会出现一个对话框,但不会使页面内容变暗。
A comment
$(function() { $('.dialogplease').dialog(); //init dialog $('.dialogplease').dialog('close'); //don't show dialog yet $('.helpdetails').click(function(e) { $('.dialogplease').dialog('open')({ modal: true }); }); });
语法错了。
你最初应该这样设置:
$(function() { $('.dialogplease').dialog({modal:true,autoOpen:false}); //init dialog $('.helpdetails').click(function(e) { $('.dialogplease').dialog('open'); }); });