开发者

New dialog in jquery

开发者 https://www.devze.com 2023-03-26 13:37 出处:网络
The following is the code in my application $(\'.roster-contact\').live(\'click\', function () { $(\'#chat-area\').dialog(\'open\');

The following is the code in my application

$('.roster-contact').live('click', function () {
    $('#chat-area').dialog('open');
    .......

When i click on a second contact, it is using the previously opened dialog, but i need to display a sep开发者_Go百科arate dialog.


I wrote a plugin, dialogWrapper, that does exactly what you want. You can use it to dynamically create dialogs without the need to pre-define them on the page: http://code.google.com/p/dialogwrapper/#Simple_dialog

Here is my blog post on it: http://mostthingsweb.com/?p=356 (post is for version 2.0.4, currently at version 2.0.7)

Download it here


Try this:

$('.roster-contact').live('click', function () {
    var div = $('<div>');
    div.dialog();
    .......
0

精彩评论

暂无评论...
验证码 换一张
取 消