Multiple Ui dialogs on the same page

I've more than one link on my page each of them opens a different UI dialog, **This is the dialog code:** $('#photo-form').dialog({ autoOpen: false, modal:true, width: 500, height:460, buttons: { "Save": function() { // do some action $(this).dialog('close'); // Close the Confirmation Box }, "Cancel": function() { //if the User Clicks the button "cancel" $(this).dialog('close'); } } }); // if a user clicks on the "delete" image $('a.album').click(function(e) { $('#photo-form').dialog('open'); }); My problem is that once I open the first dialog and then finish the action I need to do on it and then close it by clicking save or cancel, **First:** when I click the link of the second dialog it didn't open unless I reload the page and I don't want to do this. **Second:** when I try to open the same dialog again it opens the previous instant, I need to reset it. When I tried to use `$(this).dialog('destroy')` instead if `$(this).dialog('close')` for closing the first dialog, I can open the second dialog but when I clicked the link of the first dialog I couldn't open it again.
Are you saying you have two different dialogs, a "photo-form" and another, or that you have several delegated links that open the same dialog?

以上就是Multiple Ui dialogs on the same page的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准