Register for your free account! | Forgot your password?

You last visited: Today at 19:10

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Downcounter

Discussion on Downcounter within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1
 
.Panda''s Avatar
 
elite*gold: 101
Join Date: Dec 2011
Posts: 2,183
Received Thanks: 1,146
Downcounter

Hey,
wie mach ich so ein Counter der runterzählt?
.Panda' is offline  
Old 12/25/2014, 14:16   #2
dotCom
 
Devsome's Avatar
 
elite*gold: 9842
The Black Market: 107/0/0
Join Date: Mar 2009
Posts: 16,844
Received Thanks: 4,675
Mit der function würde ich eine zeit generieren lassen (1-3 sekunden)
Mit würde ich dann runterzählen
Devsome is offline  
Old 12/25/2014, 20:03   #3
 
elite*gold: 8
Join Date: Sep 2014
Posts: 625
Received Thanks: 178
Code:
	
<script type="text/javascript">
/*<![CDATA[*/
var start_count = 360;
	
function countChange() {
var a = Math.floor(Math.random() * 5);
if (a == 1) {
document.getElementById("count").innerHTML = start_count--;
}
setTimeout("countChange()", 500)
} /*]]>*/
</script>
qqdev is offline  
Thanks
1 User
Old 12/26/2014, 16:12   #4
 
.Panda''s Avatar
 
elite*gold: 101
Join Date: Dec 2011
Posts: 2,183
Received Thanks: 1,146
Ok, der Counter funktioniert jetzt, wie kann ich das einstellen das er bei 0 aufhört zu zählen?
.Panda' is offline  
Old 12/26/2014, 18:26   #5

 
adistoe's Avatar
 
elite*gold: 63
Join Date: Oct 2012
Posts: 1,181
Received Thanks: 139
Braucht nur zwei Zeilen mehr...

Code:
if (start_count > 0){
setTimeout("countChange()", 500)
}
adistoe is offline  
Thanks
1 User
Reply




All times are GMT +1. The time now is 19:12.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.