Eggtimer/basic.js
changeset 4 6c91568e58fd
parent 2 2da62bb63910
equal deleted inserted replaced
3:b43377c07b0c 4:6c91568e58fd
    93 function showValues() {
    93 function showValues() {
    94 	var hrs = Math.floor(timervalue / 3600);
    94 	var hrs = Math.floor(timervalue / 3600);
    95 	var mins = Math.floor((timervalue % 3600) / 60);
    95 	var mins = Math.floor((timervalue % 3600) / 60);
    96 	var sec = timervalue % 60;
    96 	var sec = timervalue % 60;
    97 	
    97 	
    98 	var sz = pad(hrs) + ":" + pad(mins) + ":" + pad(sec);
    98 	var sz = (hrs > 0 ? (pad(hrs) + ":") : "") + 
       
    99 			(mins > 0 ? (pad(mins) + ":") : "") + pad(sec);
    99 	document.getElementById("timervalue").innerHTML = sz;
   100 	document.getElementById("timervalue").innerHTML = sz;
   100 	var sand=document.getElementById("sand");
   101 	var sand=document.getElementById("sand");
   101 	var sandBottom = document.getElementById("sand-bottom");
   102 	var sandBottom = document.getElementById("sand-bottom");
   102 	var top, bottom;
   103 	var top, bottom;
   103 	top = (50 * (initialTimer-timervalue)/initialTimer).toFixed(0) + "%";
   104 	top = (50 * (initialTimer-timervalue)/initialTimer).toFixed(0) + "%";