<script type= "Text/javascript" >
$ (). Ready (function () {
Each additional switch, will add a row, tab1 unchanged, the other will have to re-name. Then add a set of styles to the CSS.
Timeview ();
});
Refresh Time
SetInterval ("Timeview ();", 1000);
function Timeview () {
var stardate = new Date ("2014/11/05 10:35:00"); Event Start time
var enddate = new Date ("2014/11/05 12:00:00"); Activity End Time
var nowdate = new Date (); Current time
var DIFFHD = Enddate.gettime ()-stardate.gettime (); The number of milliseconds for the time difference
alert (DIFFHD);
Calculate the total number of seconds
var seconds = Math.floor (diffhd/1000);
alert (seconds);
Calculates the difference between the active end time and the current time
var diffseconds = Enddate.gettime ()-(New Date (). GetTime ());
Alert (Enddate.gettime () + "Current time:" + (New Date (). GetTime ()));
alert (diffseconds);
var Divbox =
Timestr = ((diffseconds/seconds)/+) * + "px";
Divbox.style.width = Timestr;
$ (' #time '). CSS ("width", timestr);
jnkc.innerhtml = Timestr;
return timestr;
}
</script>
<style type= "Text/css" >
. time{width:200px; height:30px; background: #F00;}
</style>
<div style= "border:1px solid #000; width:200px; " >
<div id= "Time" class= "Time" ></div>
</div>
JS get time check and realize Countdown reading bar