我想设置对话框的宽度。为此,我使用了以下代码
$('#splashIndex').click(function() {
alert('aa');
$('#terms').dialog("option", "width", 460);
});但它不起作用。如何设置宽度?
发布于 2013-06-03 18:33:08
使用这个。
$(document).ready(function(){
$(document).on('click','#splashIndex',function() {
alert('aa');
$("#terms").dialog("option", "width", 460);
});
});发布于 2013-06-03 18:25:27
也许你没有等待DOM就绪,也许你的对话框是一个动态添加的元素。尝试使用委派,在两种情况下都有效:
$(document).on('click','#splashIndex', function () {
alert('aa');
$('#terms').dialog("option", "width", 460);
});发布于 2013-06-03 18:26:47
试一试
$("#dialogDiv").css("width", 460);https://stackoverflow.com/questions/16894583
复制相似问题