views:

74

answers:

2

Can get this to work:

$(document).ready(function(){
    $('a#reason').click(function(){
     $('div#reasonEntry').toggle();
     setTimeout($('#reasonForChange').focus(),10);
     return false;
    })
});

But can't get it to work when using show('slow');

A: 

Your code has quite a few quirks, try this out:

$(document).ready(function(){ 
  $('a#reason').click(function(){ 
    $('div#reasonEntry').show('slow'); 
    setTimeout(function(){ $('#reasonForChange').focus(); },10); 
    return false; 
  });
});
Alex Sexton
Thanks but it doesn't work...I need to use Toggle() as the div can be `opened` and `closed`.
A: 

Found the solution, thanks; http://stackoverflow.com/questions/1360917/jquery-focus-on-input

Perhaps you should mark this answer as the correct one then :)
Morningcoffee
Also, this has nearly nothing to do with what you asked in your question.
Alex Sexton
It has relevance looking at the code, but the current title of this question is misleading, since .show('slow') isn't really used.
Morningcoffee