I don't think you want to remove the dialog on the close. This
actually removes the DOM element, hence there is no dialog left to
open on subsequent clicks. Remove or comment out this line:
close: function(ev, ui) { $(this).remove(); },
Also, this line is unnecessary because it is done automatically by the
dialog widget:
title: $(this).attr("title"),
Lastly, to keep things a little cleaner, you may want to put the $
('#dialog').dialog('open'); up in the callback of your ajax post.
Currently, you dialog will open before it's content is filled from
ajax if the ajax call is a little slow.
Hth,
Dave
On Mar 29, 3:22 pm, mod_jquery <[email protected]> wrote:
> Hi, I hope someone can help with this problem. I am using ui Dialog
> that pops up on clicking a link with the same class. The problem is
> that the link work great once but if i click it again or another link
> with the same class then only the overlay loads but not the content
> box in IE only. It works great in firefox.
> My script includes an ajax post, if i remove the ajax code then the
> box works fine on every click.
>
> My code:
>
> $().ready(function() {
>
> $('#dialog').dialog({
> autoOpen:false,
> title:
> $(this).attr("title"),
> modal: true, width: 450,
> height:"auto", resizable: false,
> close: function(ev, ui) {
> $(this).remove(); },
> overlay: {
> opacity: 0.5,
> background: "black"
> }
> });
>
> $(".mybutton").click(function(){
>
> $.post($(this).attr("href"), { },
> function(data) {
> $('#dialog').html(data);
>
> }
>
> );
> $('#dialog').dialog('open');
> return false;
> });
>
> });
>
> I have multiple links with the class "mybutton" and a div with the id
> #dialog . I am also using the latest version of jQuery and ui.
> Any help would be greatly appreciated. Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---