Clock Style 001
fCol='000000';//face colour.
sCol='ff0000';//seconds colour.
mCol='000000';//minutes colour.
hCol='000000';//hours colour.
H='....';
H=H.split('');
M='.....';
M=M.split('');
S='......';
S=S.split('');
Ypos=0;
Xpos=0;
Ybase=8;
Xbase=8;
dots=12;
ns=(document.layers)?1:0;
if (ns){
dgts='1 2 3 4 5 6 7 8 9 10 11 12';
dgts=dgts.split(' ')
for (i=0; i < dots; i++){
document.write(''+dgts[i]+'');
}
for (i=0; i < M.length; i++){
document.write('');
}
for (i=0; i < H.length; i++){
document.write('');
}
for (i=0; i < S.length; i++){
document.write('');
}
}
else{
document.write('');
for (i=1; i < dots+1; i++){
document.write(''+i+'');
}
document.write('')
document.write('');
for (i=0; i < M.length; i++){
document.write('');
}
document.write('')
document.write('')
document.write('');
for (i=0; i < H.length; i++){
document.write('');
}
document.write('')
document.write('');
for (i=0; i < S.length; i++){
document.write('');
}
document.write('')
}
function clock(){
time = new Date ();
secs = time.getSeconds();
sec = -1.57 + Math.PI * secs/30;
mins = time.getMinutes();
min = -1.57 + Math.PI * mins/30;
hr = time.getHours();
hrs = -1.57 + Math.PI * hr/6 + Math.PI*parseInt(time.getMinutes())/360;
if (ns){
Ypos=window.pageYOffset+window.innerHeight-60;
Xpos=window.pageXOffset+window.innerWidth-80;
}
else{
Ypos=document.body.scrollTop+window.document.body.clientHeight-60;
Xpos=document.body.scrollLeft+window.document.body.clientWidth-60;
}
if (ns){
for (i=0; i < dots; ++i){
document.layers["nsDigits"+i].top=Ypos-5+40*Math.sin(-0.49+dots+i/1.9);
document.layers["nsDigits"+i].left=Xpos-15+40*Math.cos(-0.49+dots+i/1.9);
}
for (i=0; i < S.length; i++){
document.layers["nx"+i].top=Ypos+i*Ybase*Math.sin(sec);
document.layers["nx"+i].left=Xpos+i*Xbase*Math.cos(sec);
}
for (i=0; i < M.length; i++){
document.layers["ny"+i].top=Ypos+i*Ybase*Math.sin(min);
document.layers["ny"+i].left=Xpos+i*Xbase*Math.cos(min);
}
for (i=0; i < H.length; i++){
document.layers["nz"+i].top=Ypos+i*Ybase*Math.sin(hrs);
document.layers["nz"+i].left=Xpos+i*Xbase*Math.cos(hrs);
}
}
else{
for (i=0; i < dots; ++i){
ieDigits[i].style.pixelTop=Ypos-15+40*Math.sin(-0.49+dots+i/1.9);
ieDigits[i].style.pixelLeft=Xpos-14+40*Math.cos(-0.49+dots+i/1.9);
}
for (i=0; i < S.length; i++){
x[i].style.pixelTop =Ypos+i*Ybase*Math.sin(sec);
x[i].style.pixelLeft=Xpos+i*Xbase*Math.cos(sec);
}
for (i=0; i < M.length; i++){
y[i].style.pixelTop =Ypos+i*Ybase*Math.sin(min);
y[i].style.pixelLeft=Xpos+i*Xbase*Math.cos(min);
}
for (i=0; i < H.length; i++){
z[i].style.pixelTop =Ypos+i*Ybase*Math.sin(hrs);
z[i].style.pixelLeft=Xpos+i*Xbase*Math.cos(hrs);
}
}
setTimeout('clock()',50);
}
if (document.layers || document.all) window.onload=clock;
A:hover {color: #FF0000; font-family: Arial; font-weight: bold}
Back
Clock Style 001
This script will place a clock in the
lower right corner of the webpage. There is nothing to configure.
Just place the script between the <HEAD></HEAD> tags of the HTML Document.
fCol='000000';//face colour.
sCol='ff0000';//seconds colour.
mCol='000000';//minutes colour.
hCol='000000';//hours colour.
H='....';
H=H.split('');
M='.....';
M=M.split('');
S='......';
S=S.split('');
Ypos=0;
Xpos=0;
Ybase=8;
Xbase=8;
dots=12;
ns=(document.layers)?1:0;
if (ns){
dgts='1 2 3 4 5 6 7 8 9 10 11 12';
dgts=dgts.split(' ')
for (i=0; i < dots; i++){
document.write(''+dgts[i]+'');
}
for (i=0; i < M.length; i++){
document.write('');
}
for (i=0; i < H.length; i++){
document.write('');
}
for (i=0; i < S.length; i++){
document.write('');
}
}
else{
document.write('');
for (i=1; i < dots+1; i++){
document.write(''+i+'');
}
document.write('')
document.write('');
for (i=0; i < M.length; i++){
document.write('');
}
document.write('')
document.write('')
document.write('');
for (i=0; i < H.length; i++){
document.write('');
}
document.write('')
document.write('');
for (i=0; i < S.length; i++){
document.write('');
}
document.write('')
}
function clock(){
time = new Date ();
secs = time.getSeconds();
sec = -1.57 + Math.PI * secs/30;
mins = time.getMinutes();
min = -1.57 + Math.PI * mins/30;
hr = time.getHours();
hrs = -1.57 + Math.PI * hr/6 + Math.PI*parseInt(time.getMinutes())/360;
if (ns){
Ypos=window.pageYOffset+window.innerHeight-60;
Xpos=window.pageXOffset+window.innerWidth-80;
}
else{
Ypos=document.body.scrollTop+window.document.body.clientHeight-60;
Xpos=document.body.scrollLeft+window.document.body.clientWidth-60;
}
if (ns){
for (i=0; i < dots; ++i){
document.layers["nsDigits"+i].top=Ypos-5+40*Math.sin(-0.49+dots+i/1.9);
document.layers["nsDigits"+i].left=Xpos-15+40*Math.cos(-0.49+dots+i/1.9);
}
for (i=0; i < S.length; i++){
document.layers["nx"+i].top=Ypos+i*Ybase*Math.sin(sec);
document.layers["nx"+i].left=Xpos+i*Xbase*Math.cos(sec);
}
for (i=0; i < M.length; i++){
document.layers["ny"+i].top=Ypos+i*Ybase*Math.sin(min);
document.layers["ny"+i].left=Xpos+i*Xbase*Math.cos(min);
}
for (i=0; i < H.length; i++){
document.layers["nz"+i].top=Ypos+i*Ybase*Math.sin(hrs);
document.layers["nz"+i].left=Xpos+i*Xbase*Math.cos(hrs);
}
}
else{
for (i=0; i < dots; ++i){
ieDigits[i].style.pixelTop=Ypos-15+40*Math.sin(-0.49+dots+i/1.9);
ieDigits[i].style.pixelLeft=Xpos-14+40*Math.cos(-0.49+dots+i/1.9);
}
for (i=0; i < S.length; i++){
x[i].style.pixelTop =Ypos+i*Ybase*Math.sin(sec);
x[i].style.pixelLeft=Xpos+i*Xbase*Math.cos(sec);
}
for (i=0; i < M.length; i++){
y[i].style.pixelTop =Ypos+i*Ybase*Math.sin(min);
y[i].style.pixelLeft=Xpos+i*Xbase*Math.cos(min);
}
for (i=0; i < H.length; i++){
z[i].style.pixelTop =Ypos+i*Ybase*Math.sin(hrs);
z[i].style.pixelLeft=Xpos+i*Xbase*Math.cos(hrs);
}
}
setTimeout('clock()',50);
}
if (document.layers || document.all) window.onload=clock;
© Copyright 2003
Ultimatephp.com
Wyszukiwarka
Podobne podstrony:
Blaupunkt CR5WH Alarm Clock Radio instrukcja EN i PLstyleedit styleTHE CLOCK zegar telling the time podawanie godzin i cwiczeniaCLOCK (2)yamaha style ludowe DieSternStyle jstest style reprezentacjiyamaha style ludowe Urlaubszscroll clockoutline stylestyle yamaha style do konkretnych utworów Rosenberg 1STYLE I POSTAWY WYCHOWANIAoption force hex style colorswięcej podobnych podstron