LCD Digital Clock

JavaScriptBank

Bannato
26 Nov 2009
86
0
0
This digital clock JavaScript code attempts to parody that cool 'glowing in the dark night' look of a LCD clock watch by its interface. LCD displays the ... detail at JavaScriptBank.com - 2.000+ free JavaScript codes


How to setup

Step 1: Use CSS code below for styling the script
CSS
Codice:
<style>
<!--
.styling{
background-color:black;
color:lime;
font: bold 15px MS Sans Serif;
padding: 3px;
}
-->
</style>

Step 2: Place JavaScript below in your HEAD section
JavaScript
Codice:
<script>
<!--
/*****************************************
* LCD Clock script- by Javascriptkit.com
*****************************************/

var alternate=0
var standardbrowser=!document.all&&!document.getElementById

if (standardbrowser)
document.write('<form name="tick"><input type="text" name="tock" size="6"></form>')

function show(){
if (!standardbrowser)
var clockobj=document.getElementById? document.getElementById("digitalclock") : document.all.digitalclock
var Digital=new Date()
var hours=Digital.getHours()
var minutes=Digital.getMinutes()
var dn="AM"

if (hours==12) dn="PM" 
if (hours>12){
dn="PM"
hours=hours-12
}
if (hours==0) hours=12
if (hours.toString().length==1)
hours="0"+hours
if (minutes<=9)
minutes="0"+minutes

if (standardbrowser){
if (alternate==0)
document.tick.tock.value=hours+" : "+minutes+" "+dn
else
document.tick.tock.value=hours+"   "+minutes+" "+dn
}
else{
if (alternate==0)
clockobj.innerHTML=hours+"<font color='lime'>&nbsp;:&nbsp;</font>"+minutes+" "+"<sup style='font-size:1px'>"+dn+"</sup>"
else
clockobj.innerHTML=hours+"<font color='black'>&nbsp;:&nbsp;</font>"+minutes+" "+"<sup style='font-size:1px'>"+dn+"</sup>"
}
alternate=(alternate==0)? 1 : 0
setTimeout("show()",1000)
}
window.onload=show

//-->
</script>

Step 3: Copy & Paste HTML code below in your BODY section
HTML
Codice:
<span id="digitalclock" class="styling"></span>






 
Discussioni simili
Autore Titolo Forum Risposte Data
felino TV LCD, Google Chromecast e audio in uscita Discussioni Varie 1
7 sostitituito display lcd per portatile Toshiba Hardware 0
alex84freeangel Differenze Monitor LCD 19 e 17 Discussioni Varie 0
J Helpme LCD Notebook Hardware 1
R Lampade LCD notebook Hardware 0
G [PHP] Web Service Digital Hun Zucchetti Windows e Software 2
felino Western Digital non riconosciuto, Unita' non allocata Hardware 0
GFCapozzi Ciao, mi presento- sono un digital marketer che vive a Malta.. Presentati al Forum 1
N Entrare nel mondo web-digital Discussioni Varie 0
E Corso gratuito digital marketing Annunci servizi di Social Media Marketing 3
baobabdesign [CERCO LAVORO] Digital designer freelance Offerte e Richieste di Lavoro e/o Collaborazione 4
baobabdesign Cerco lavoro come Digital designer Offerte e Richieste di Lavoro e/o Collaborazione 0
J jsClock: Featured Digital Clock JavaScript Javascript 0
J 10 Tiptop Analog and Digital Clock Resources and Techniques with Javascript Javascript 1
E Webmaster e' nato il digital franchising !! Presenta il tuo Sito 0
A Digital-designs Presenta il tuo Sito 0
A Amministrazione Digital-Designs Elaborazione Siti Web, Open Source PHP, Flash HTML e CSS 0
J JavaScript Word Clock: Spell the Time Javascript 0
J Trailing Clock Cursor Javascript 0
J CoolClock - Super nice Javascript Analog Clock Javascript 0
J World Clock script Javascript 0
J World clock with unique display Javascript 0

Discussioni simili