i have a div that i hide inline (display:none)
then i have a button to use jquery to fade that div in ... it works, except you have to click twice for it to fade in ... can anyone see what i need to change?? thanks
this is the function function accordionFader() { $('#hide').click(function() { $('#accordionWrapper').fadeOut('slow', function() { // Animation complete. }); }); $('#show').click(function() { $('#accordionWrapper').fadeIn('slow', function() { // Animation complete. }); }); }
here's the button that calls the function: SHOW
It's not triggering because the first click triggers the setting of the event. What you should do is match the element with the click event outside of the HTML.
Pull the code you have out of the accordionFader function and it'll work fine.
ah. thanks