?
Solved

Ajax loading div with decrementing counter

Posted on 2011-03-04
7
Medium Priority
?
414 Views
Last Modified: 2012-05-11
Hi,
I have already set up a loading div and I pass php based time to it.
what I looking for is a nice loading div with the decrementing counter - I can pass the counter/time to it

It would be great if some one could help me out with it.

Thanks,
Sameer.
0
Comment
Question by:SameerMirza
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 8

Expert Comment

by:McNetic
ID: 35081616
If you can provide a working code sample of what you already have, I'll try to help you find a solution. I don't exactly understand what you have, and what you want to get.
0
 

Author Comment

by:SameerMirza
ID: 35082880
its just be java script, AJAX and CSS I belive or may be only CSS.
I am sure you are aware of timer functions in javascript
lets say I have 60 secnods
All I want to show is display the counter 60, 59, 58....seconds remaining
Although I have changed my design but it would be goog to find a solution
I hope you understand what I want achieve
0
 
LVL 8

Accepted Solution

by:
McNetic earned 2000 total points
ID: 35083079
That could be as simple as this:

<div id="counter">Counter
</div>
<script type="text/javascript">
function countdown(start) {
	if ('undefined' == typeof(start)) {
		start = parseInt(document.getElementById('counter').firstChild.data) - 1;
	}
	document.getElementById('counter').firstChild.data = start;
	if (0 < start) {
		setTimeout(countdown, 1000);
	}
}
countdown(60);
</script>

Open in new window

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:SameerMirza
ID: 35083859
thanks for your help. It would be done like this but I am not exactly what I am looking for.
for example we say setTimeout(countdown, 60000);
I am looking for a counter to be display as 60 - 59 - 58 untlil it reaches 0
mean 60 sec to 0 secs waiting div.
0
 
LVL 8

Expert Comment

by:McNetic
ID: 35086856
Uhm, I'm afraid we've got a little misunderstanding. What do you mean by waiting div? Did you try my code? It does display a div, starting with 60, counting down to 0, decrementing by 1 every second.
0
 

Author Comment

by:SameerMirza
ID: 35093333
hey it man :) my bad
0
 

Author Closing Comment

by:SameerMirza
ID: 35093336
it works :)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The most up-to-date version of this article is on my Blog https://iconoun.com/blog/
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question