Acest script va afisa un ceas ca in exemplu de mai jos

abcdefghj

Pentru a adauga acest script intr-o pagina web:
1. Copiati imaginile care compun ceasul de aici -> Imgs; dezarhivati arhiva ".zip" si salvati directorul "imgs" in acelasi loc unde se afla pagina HTML.
2. Introduceti in sectiunea HEAD a documentului HTML urmatorul cod:
<script type="text/javascript">
<!--
var dn
c1=new Image(); c1.src="imgs/c1.gif"
c2=new Image(); c2.src="imgs/c2.gif"
c3=new Image(); c3.src="imgs/c3.gif"
c4=new Image(); c4.src="imgs/c4.gif"
c5=new Image(); c5.src="imgs/c5.gif"
c6=new Image(); c6.src="imgs/c6.gif"
c7=new Image(); c7.src="imgs/c7.gif"
c8=new Image(); c8.src="imgs/c8.gif"
c9=new Image(); c9.src="imgs/c9.gif"
c0=new Image(); c0.src="imgs/c0.gif"
cb=new Image(); cb.src="imgs/cb.gif"
cam=new Image(); cam.src="imgs/cam.gif"
cpm=new Image(); cpm.src="imgs/cpm.gif"

function extract(h,m,s,type){
  if (!document.images)
    return
  if (h<=9) {
    document.images.a.src=cb.src
    document.images.b.src=eval("c"+h+".src")
  }
  else {
    document.images.a.src=eval("c"+Math.floor(h/10)+".src")
    document.images.b.src=eval("c"+(h%10)+".src")
  }
  if (m<=9) {
    document.images.d.src=c0.src
    document.images.e.src=eval("c"+m+".src")
  }
  else {
    document.images.d.src=eval("c"+Math.floor(m/10)+".src")
    document.images.e.src=eval("c"+(m%10)+".src")
  }
  if (s<=9) {
    document.g.src=c0.src
    document.images.h.src=eval("c"+s+".src")
  }
  else {
    document.images.g.src=eval("c"+Math.floor(s/10)+".src")
    document.images.h.src=eval("c"+(s%10)+".src")
  }
  if (dn=="AM") document.j.src=cam.src
  else document.images.j.src=cpm.src
}

function ceas() {
 if (!document.images)
    return
  var Digital=new Date()
  var hours=Digital.getHours()
  var minutes=Digital.getMinutes()
  var seconds=Digital.getSeconds()
  dn="AM"
  if ((hours>=12)&&(minutes>=1)||(hours>=13)) {
    dn="PM"
    hours=hours-12
  }
  if (hours==0)
    hours=12
  extract(hours,minutes,seconds,dn)
  setTimeout("ceas()",1000)
}
//-->
</script>

3. In interiorul tag-ului <body> scrieti onload="ceas()", sa arate asa: <body onload="ceas()">
4. Dupa tagul <body> adaugati urmatorul cod HTML, in locatia unde vreti sa apara ceasul:
<img src="imgs/cb.gif" name="a"><img src="imgs/cb.gif" name="b"><img src="imgs/colon.gif" name="c"><img src="imgs/cb.gif" name="d"><img src="imgs/cb.gif" name="e"><img src="imgs/colon.gif" name="f"><img src="imgs/cb.gif" name="g"><img src="imgs/cb.gif" name="h"><img src="cam.gif" name="j">

Un Test simplu in fiecare zi

HTML
CSS
JavaScript
PHP-MySQL
Engleza
Spaniola
Ce atribut indica faptul ca un camp de formular trebuie completat?
required="required" autofocus="autofocus" placeholder="text"
<input type="text" name="name1" required="required" />
Ce metoda CSS misoreaza sau mareste dimensiunile unui element (inclusiv continutul)?
translate() scale() skew()
#some_id:hover {
  transform: scale(2, 1.5);
  -ms-transform: scale(2, 1.5);    /* IE 9 */
  -moz-transform: scale(2, 1.5);   /* Firefox */
}
Click pe metoda obiectului Date care returneaza ziua din luna.
setDate() getMonth() getDate()
var rightnow = new Date();
var day = rightnow.getDate();
alert(day);
Ce functie este folosita pentru a incarca un fisier pe server?
is_file() move_uploaded_file() fopen()
if(move_uploaded_file($_FILES["field_name"]["tmp_name"], "dir/file_name")) {
  echo "Fisierul a fost incarcat";
}
Cum se spune in engleza expresia: "Ploua cu galeata"?
rain cats and dogs rain buckets quiet rain
In Bucharest it`s raining cats and dogs.
- In Bucuresti ploua cu galeata.
Cum se spune in spaniola expresia: "Ploua cu galeata"?
llover cubo llover a cántaros lluvia tranquila
En Madrid está lloviendo a cántaros.
- In Madrid ploua cu galeata.
Script pentru ceas

Last accessed pages

  1. Cursuri si Tutoriale: Engleza, Spaniola, HTML, CSS, Php-Mysql, JavaScript, Ajax (69952)
  2. Gramatica limbii spaniole. Indrumator si prezentare generala (26472)
  3. Trecut perfect si Trecutul perfect continuu - Past perfect and Continuous (27314)
  4. Curs PHP MySQL, Tutoriale si Scripturi PHP (14228)
  5. Limba spaniola curs online incepatori si avansati (13193)

Popular pages this month

  1. Cursuri si Tutoriale: Engleza, Spaniola, HTML, CSS, Php-Mysql, JavaScript, Ajax (2271)
  2. Curs HTML gratuit Tutoriale HTML5 (1633)
  3. Curs si Tutoriale JavaScript (1600)
  4. Curs PHP MySQL, Tutoriale si Scripturi PHP (1551)
  5. Curs CSS Online Tutoriale CSS3 (1434)