Binary Clock (Javascript)

Default look

<div style="width: 120px; height: 80px; margin: 10px;" id="binaryTimeDiv"></div>
<script src="http://media.plweb.se/upload/files/binarytime.js" type="text/javascript"></script>
<script type="text/javascript">se.plweb.binaryTime();</script>

Requirements

  1. The javascript source file or the minified javascript source file
  2. a div tag with an id attribute and style attribute with an width and height in pixels, the width should be even dividable with 6 and bigger then 0 and the height should be even dividable with 4 and bigger then 0
  3. a script tag with Javascript source
  4. a script tag with Javascript source for starting the clock

Settings

on color

se.plweb.binaryTime( { color:{ on :"#FF0000" } } );

off color

se.plweb.binaryTime( { color:{ off :"#CCC" } } );

inactive color

se.plweb.binaryTime( { color:{ inactive :"#FF0000" } } );

all colors

se.plweb.binaryTime( {
color: {
on: "#FF0000",
off: "transparent",
inactive: "#CCC"
}
} );

div id

se.plweb.binaryTime( {
binaryTimeDivId: "binaryTimeDiv"
} );

all params

se.plweb.binaryTime( {
binaryTimeDivId: "binaryTimeDiv",
color: { on: "#FF0000",
off: "transparent",
inactive: "#CCC"
}
} );

Leave a Reply