[gnome3-web] Only display countdown when the value has been calculated



commit ad9d64cd7b329712996162df8c84ea9d320d15e1
Author: Frédéric Péters <fpeters 0d be>
Date:   Fri Apr 1 13:25:19 2011 +0530

    Only display countdown when the value has been calculated

 index.html      |    2 +-
 js/countdown.js |    2 ++
 2 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/index.html b/index.html
index 40deeb3..fa38b28 100644
--- a/index.html
+++ b/index.html
@@ -27,7 +27,7 @@
   <div class="grid_10 prefix_1">
     <ul class="navigation"><li><a href="index.html">Home</a></li><li><a href="faq.html">Common questions and answers
 </a></li><li><a href="tryit.html">Try it out!</a></li></ul>
-<div class="countdown">Releasing awesome in: <span id="countbox"></span></div>
+<div class="countdown" style="visibility: hidden;">Releasing awesome in: <span id="countbox"></span></div>
   </div><!-- grid_12 -->
 </div>
 <div class="container_16">
diff --git a/js/countdown.js b/js/countdown.js
index 5c0137f..77d3f06 100644
--- a/js/countdown.js
+++ b/js/countdown.js
@@ -27,6 +27,7 @@ function GetCount(){
 	// time is already past
 	if(amount < 0){
 		document.getElementById('countbox').innerHTML="Now!";
+		document.getElementById('countbox').parentNode.style.visibility = 'visible';
 	}
 	// date is still good
 	else{
@@ -50,6 +51,7 @@ function GetCount(){
 		if(days != 0 || hours != 0 || mins != 0){out += mins +" minute"+((mins!=1)?"s":"")+", ";}
 		out += secs +" seconds";
 		document.getElementById('countbox').innerHTML=out;
+		document.getElementById('countbox').parentNode.style.visibility = 'visible';
 
 		setTimeout("GetCount()", 1000);
 	}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]