jquery - SlideDown Div with Close link -


greetins,

i wanna use sliding div displaying messages "profile updated".

this code. div slides down when load page , dissapers after few seconds (the delay). want able close div before timeout link, cant attach slideup it... why?

    $("#message").hide();       $("#message").slidetoggle('slow', function() {         $(this).delay(2000).slidetoggle("slow");      });      $("#close").click(function() {         $("#message").slideup();     });       });      <div id="message" style="display:none; border: 3px solid #ccc; width: 500px; height: 30px; background: #eee;">     message goes here! <a id="close" href="#" style="float: right;">close div</a>     </div> 

try adding .stop() close div click event.

$("#close").click(function() {     $("#message").stop().slideup(); }); 

jsfiddle example


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -