RubyRedGrapefruit
RubyRedGrapefruit

Reputation: 12224

Why is my jQuery dialog not opening like it is supposed to?

Using jQuery 1.4.4. When a user mouses over the table element below, I want a dialog box to appear containing the values in the div below.

My html:

<div class="dialog" id="dialog1" style="display:none">
  <%= responsibility.user.last_name %>  
</div>
<td><a class="opener" data-dialogid="dialog1"><%= responsibility.user.email %></a></td>

My jQuery code:

$('.dialog').dialog({
    autoOpen: false,
    title: 'Basic Dialog',
    resizable: false,
    position: ['center',150],
    width: 450
    });

$('.opener').mouseover(function() {
    var $dialog = $($(this).data("dialogid"));
    $dialog.dialog('open');
});

I asked an earlier question that I hoped would get me through this part, but I'm at a brick wall again. Firebug doesn't even report errors on it, so there is no humanly possible way to solve it without asking somebody I guess.

Upvotes: 0

Views: 126

Answers (1)

Chandu
Chandu

Reputation: 82933

Try chaging the mouseover to as below:

$('.opener').mouseover(function() { 
    var $dialog = $("#" + $(this).data("dialogid")); 
    $dialog.dialog('open'); 
}); 

Upvotes: 2

Related Questions