javascript - jQuery - flashMessage close button -


short question:

$(document).ready(function(){     $('.flash-notice .close').click(function(e){         $('.flash-notice').fadeout(250);         e.preventdefault();     });         $('.flash-notice').delay(3000,).fadeout(1000); 

when click on .close element of flash notice, nothing happens. fades after 3 seconds. if show again , click on .close again, works.

i guess it's bit messed trying close box while it's being closed.

how can solve that?

thanks!

        $('.flash-notice').delay(3000).fadeout(1000);         $('.flash-notice .close a').click(function(e){             e.preventdefault();             $('.flash-notice').stop().fadeout(250);         }); 

i forgot stop()


Comments