tags:

views:

34

answers:

2

Hello,

I have this code to popup a JQuery dialog box:

$( "#dialogBox" ).dialog({
   height: 585,
   width: 620,  
   modal: true,
   resizable: false,    
   show: { 
     effect: 'fold', 
     complete: function() { $("#txtEmail").focus(); }
   }                                
});

The dialog box appears correctly except for the effect. No matter what effect I choose, the box appears the same way (grows from top left to bottom right).

Any ideas? Thanks.

+3  A: 

This isn't supported in jQuery UI 1.8, though it's slated for 1.9: http://dev.jqueryui.com/ticket/2358

For now you can just do the effect itself (no options) like this:

show: 'fold', 
Nick Craver
Darn, well I guess that explains it. Any other suggestions on how to focus the text field after the dialog has finished animating?
Jon
@Jon - You could fold hide and fold the area in the `open` callback, then do the `focus` as the callback, not pretty (and won't queue) but it works.
Nick Craver
Thanks, I ended up adding a SetTimeout to the focus function which seemed to do the trick.
Jon
A: 
$( "#dialogBox" ).dialog({
   open: function(){$("#txtEmail").focus();},
   height: 585,
   width: 620,  
   modal: true,
   resizable: false,    
   show: 'fold'
});
Detect
I can see it focus the fields when the dialog opens, but once the animation finishes it loses focus.
Jon