Sunday, June 2, 2024
 Popular · Latest · Hot · Upcoming
127
rated 0 times [  128] [ 1]  / answers: 1 / hits: 26997  / 11 Years ago, fri, october 11, 2013, 12:00:00

In my web site I need to pop up a dummy 'loading' spinning wheel when click a button and vanish after some time. It's just a dummy page. I would be much obliged if anyone can explain how to do such a thing. Can I do this with javascript or jQuery?



Thanx in advance


More From » jquery

 Answers
11

Have a div/image in the right place you need, hide it first time the page loaded. like



<input type=button id=button/>
<div id=load><img src=http://jimpunk.net/Loading/wp-content/uploads/loading1.gif/>
</div>


and in your jquery, set a handler for the click event of button to show or hide the div



$(document).ready(function(){
$('#button').click(function(){
$('#load').show();
setTimeout(function() {$('#load').hide()}, 2000);
});
});


setTimout can be used to hide the div after some time.
check the workign example here


[#75063] Thursday, October 10, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
faithemilys

Total Points: 418
Total Questions: 100
Total Answers: 114

Location: North Korea
Member since Fri, Nov 4, 2022
2 Years ago
;