0
我有多個jquery ui對話框在頁面上動態生成,我如何定位和打開個人?如何打開個人jQuery對話框
需要有2種方式打開對話框,標記(使用傳單地圖)以及與地圖上的標記對應的一組側邊欄項目。點擊該標記打開正確的對話框,而是點擊個別側邊欄打開所有的對話框......
我有代碼:
$(function() {
var projectDialog = $('<div id="' + L.Util.stamp(e.layer) +'" class="model-wrap">\
' + pDesc + '\
</div>');
projectDialog.dialog({
modal: true,
autoOpen: false,
title: pName,
show: 'fade',
hide: 'fade',
dialogClass: (e.layer)
});
$(e.layer).click(function() {
projectDialog.dialog('open');
});
// this is the sidebar link items - each item is given an id & href matching the corresponding e.layer
$('.item').click(function (e) {
e.preventDefault();
projectDialog.dialog('open');
return false;
});
});