view www/martin/js/countin.js @ 91:1a706a2880ee

reset bug fixed but still todo unit transect to 0 reset
author Rob Canning <rob@foo.net>
date Thu, 31 Jul 2014 00:16:27 +0100
parents b7f9ade92165
children
line wrap: on
line source
/////////////////////////////////////////////////
// countdown to change
var socket = io.connect();

socket.on("countinFromServer", countinClient);
function countinClient(groupID, currentseconds,mm,text,colour,background){
    var groupPage=document.getElementById('group').value
    if (groupID == groupPage) {
	console.log(currentseconds);
	document.getElementById("countinnumber").style.visibility="visible";
	document.getElementById("countinnumber").style.visibility="visible";
	//$("#countin").text(text);
	$("#countinnumber").text(currentseconds);
	$("#countinnumber").css('background-color', background);
	
	document.getElementById("countinnumber").style.color=colour;

	if ( currentseconds == 0) {
	    document.getElementById("countinnumber").style.visibility='hidden';
//	    document.getElementById("countin").style.visibility='hidden';
	}
    }}

/////////////////////////////////////////////////