Page 1 of 1
Hide div after few seconds
Posted: Mon Jan 04, 2010 11:28 pm
by GinsBabu
Hi,
In my form i have a button which calls a js function to do some action.After the action a message shows.I want to know how can i hide the div if the message has been shown for 10 second.Any help?
Re: Hide div after few seconds
Posted: Mon Jan 04, 2010 11:54 pm
by Christopher
Use one of the Javascript timer functions (setTimeout(), clearTimeout(), setInterval() and clearInterval() ). They will call a function after a specified amount of time. Set it for 10 seconds and have the function you pass to it hide the div.
Re: Hide div after few seconds
Posted: Tue Jan 05, 2010 1:08 am
by GinsBabu
Hi..
Thanks arborint ....i was working on that but still its not working...my code was
have a div tag like this..
<div id="d" style="display:inline">
<?php echo $this->message;?>
</div>
and the js
function sendStatusReport(){
document.listclientchoosen.action = "<?php echo $this->baseUrl;?>/admin/clientexports/report";
document.listclientchoosen.submit();
setTimeout("toggle()", 8000 );
}
function toggle() {
var ele = document.getElementById("d");
ele.style.display = "none";
}
Wat am i doing wrong....??also the action performing inside the sendstatusreport() is mail sending.So it amy took 8s or 10 s or 15 s.How can excatly point out the time.