我想通過在按鈕和內容div上使用相同的類來打開多個對話框。下面的作品,但只有第一次。jquery ui對話框在按鈕和內容div上使用相同的類打開多個對話框
jQuery('.helpDialog').hide();
jQuery('.helpButton').click(function() {
jQuery(this).next('.helpDialog').dialog({
autoOpen: true,
title: 'Help',
width: 500,
height: 300,
position: [180,10],
draggable: true,
resizable: false,
modal: false
});
return false;
});
我們知道這個 http://blog.nemikor.com/2009/04/08/basic-usage-of-the-jquery-ui-dialog/ 的原因「的第二個呼叫被忽略,因爲對話框已實例化的元素。」
但是,當我通過嘗試下面的代碼解決該問題時,對話框不再打開。 任何人都可以幫忙嗎? 在此先感謝
jQuery('.helpDialog').hide();
jQuery(function() {
jQuery('.helpDialog').dialog({
autoOpen: false,
modal: true,
title: 'Info',
width: 600,
height: 400,
position: [200,0],
draggable: false
});
});
jQuery('.helpButton').click(function() {
jQuery(this).next('.helpDialog').dialog('open');
return false;
});
哇,這是如此之快,我已經得到了它啓動和運行感謝尼克。 – MichaelAntoni 2010-12-23 13:13:31