javascript 倒计时

var hhhh = 300;

	(function daoJiShi() {

		var ofm = parseInt((hhhh % 3600) / 60);
		var ofs = hhhh % 60;
		document.getElementById('timer').innerHTML = '<font size="3"  face="微软雅黑"  color="RGB(248,248,58)">制品正在解析中,还有 </font>' 
			+ '<font size="3"  face="微软雅黑"  color="red">'+ofm +'</font>'
				+ '<font size="3"  face="微软雅黑"  color="RGB(248,248,58)"> 分钟 </font>' 
				+'<font size="3"  face="微软雅黑"  color="red">'+ofs+'</font>'
					+ ' <font size="3"  face="微软雅黑"  color="RGB(248,248,58)">秒,请稍候...</font>';
		if (ofs < 0) {
			document.getElementById('timer').innerHTML = '<font size="3"  face="微软雅黑"  color="RGB(248,248,58)">倒计时结束!</font>';
			return;
		}
		;
		hhhh = hhhh - 1;
		setTimeout('daoJiShi()', 1000);
	}());

你可能感兴趣的:(JavaScript)