Link to home
Start Free TrialLog in
Avatar of swaggerking
swaggerkingFlag for United States of America

asked on

Make div disappear after a few seconds

I'm using the following script that displays a div for a few seconds and then it disappears. I would like it to ease away more gracefully than the current script I'm using. Can this be done in Jquery and if so, how can I apply it to the following code.

<script type="text/javascript">
// close the div in 5 secs
window.setTimeout("closeHelpDiv();", 5000);

function closeHelpDiv(){
document.getElementById("helpdiv").style.display=" none";
}
</script>


<%
If Request.QueryString("Update")="Success" Then
%>
   <div id="helpdiv" class="corners">
    <img src="../images/Icons/changes_saved.png" width="171" height="50"/>
    </div>        
<%end if
%>
Avatar of kadaba
kadaba
Flag of India image

document.getElementById("helpdiv").style.display=" none";
instead
$("helpdiv").hide('slow');
Avatar of swaggerking

ASKER

kadaba:
Is this what you mean?

<script type="text/javascript">
// close the div in 5 secs
window.setTimeout("closeHelpDiv();", 8000);

function closeHelpDiv(){
$("helpdiv").hide('slow');
}
</script>

If so, it now not disappearing at all.
ASKER CERTIFIED SOLUTION
Avatar of kadaba
kadaba
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Worked like a charm. Much appreciation!