begin process at 2012 02 11 04:28:27
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Fenêtre & Pop-up

 > POPUP TRES SPECIAL ->DATE ET HEURE EN FRANCAIS AVEC ZEROS SIGNIFICATIS ET PLURIELS

POPUP TRES SPECIAL ->DATE ET HEURE EN FRANCAIS AVEC ZEROS SIGNIFICATIS ET PLURIELS


 Information sur la source

Note :
5 / 10 - par 2 personnes
5,00 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Fenêtre & Pop-up Niveau :Débutant Date de création :13/11/2003 Vu :7 017

Auteur : Ludwig_

Ecrire un message privé
Commentaire sur cette source (1)
Ajouter un commentaire et/ou une note

 Description

Ce script donne la date et l'heure (zeros significatifs + pluriels necessaires)
sous forme de popup tres speciale

Source

  • <SCRIPT language=JavaScript>
  • versionum = navigator.appVersion.substring(0,1);
  • if (versionum < 3)
  • type = false;
  • else
  • type = true;
  • today = new Date;
  • numero = today.getDate();
  • if (numero<10)
  • numero = "0"+numero;
  • if (type )
  • annee = today.getFullYear();
  • else
  • annee = today.getYear();
  • listjour = new Array("dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi");
  • listmois = new Array("janvier","f&eacute;vrier","mars","avril","mai","juin","juillet","aout","septembre","octobre","novembre","d&eacute;cembre");
  • jour = listjour [ today.getDay()] + " " + numero + " " + listmois [today.getMonth()] + " " + annee;
  • heure = today.getHours();
  • minute = today.getMinutes();
  • seconde = today.getSeconds();
  • milli = today.getMilliseconds();
  • if(heure > 1)
  • pluriel1="s";
  • else
  • pluriel1="";
  • if(minute > 1)
  • pluriel2="s";
  • else
  • pluriel2="";
  • if(seconde > 1)
  • pluriel3="s";
  • else
  • pluriel3="";
  • if(heure < 10)
  • zero1="0";
  • else
  • zero1="";
  • if(minute < 10)
  • zero2="0";
  • else
  • zero2="";
  • if(seconde < 10)
  • zero3="0";
  • else
  • zero3="";
  • quelleheure = zero1 + heure + " heure" + pluriel1 + " " + zero2 + minute + " minute" + pluriel2 + " " + zero3 + seconde + " seconde" + pluriel3;
  • // PARAMETRES
  • var fonc_mess = 'Nous sommes le' ;
  • var fonc_mezz = 'et il est'
  • var fonc_background = '#000000'
  • var fonc_bordure = '#0000FF'
  • var fonc_police = 'Arial Rounded MT Bold'
  • var fonc_police_taille = '20'
  • var fonc_police_color = '#FFFFFF'
  • var fonc_hauteur = 137
  • var fonc_largeur = 430
  • var fonc_box2 = 0;
  • // CADRES
  • fonc_classe = 'border-color:'+fonc_bordure+';border-style:solid;border-width:1px;background:'+fonc_background+';font-family:'+fonc_police+';font-size:'+fonc_police_taille+'px;color:'+fonc_police_color;
  • if(document.getElementById)
  • {
  • document.write('<DIV ID=fonc_box1 STYLE="position:absolute;visibility:hidden;'+fonc_classe+';width:20;height:'+(fonc_hauteur+20)+';z-index:10"></DIV>');
  • document.write('<DIV ID=fonc_box2 STYLE="position:absolute;visibility:hidden;'+fonc_classe+';width:'+fonc_box2+';height:'+fonc_hauteur+';z-index:5');
  • if(document.all)
  • document.write(';padding:10');
  • document.write('"></DIV>');
  • document.write('<DIV ID=fonc_box3 STYLE="position:absolute;visibility:hidden;'+fonc_classe+';width:20;height:'+(fonc_hauteur+20)+';z-index:10"></DIV>');
  • // TAILLE DE L'ECRAN
  • fonc_Y = document.body.clientHeight;
  • fonc_X = document.body.clientWidth;
  • fonc_posX = Math.round(fonc_X/2);
  • fonc_posY = Math.round(fonc_Y/2)-Math.round(fonc_hauteur/2);
  • }
  • function fonc_deplace()
  • {
  • // PLACEMENT
  • document.getElementById("fonc_box1").style.left = fonc_posX-20-(fonc_box2/2);
  • document.getElementById("fonc_box3").style.left = fonc_posX+(fonc_box2/2);
  • document.getElementById("fonc_box2").style.left = fonc_posX-(fonc_box2/2)-5;
  • document.getElementById("fonc_box2").style.width = fonc_box2+10;
  • fonc_box2 += 5;
  • if(fonc_box2<fonc_largeur)
  • setTimeout("fonc_deplace()",10);
  • else
  • {
  • document.getElementById("fonc_box2").innerHTML = '<CENTER>'+fonc_mess+'<BR>'+jour+'<BR>'+fonc_mezz+'<BR>'+quelleheure+'<BR><B><A HREF=javascript:fonc_close()><FONT COLOR='+fonc_police_color+'>OK</FONT></A></B></CENTER>'
  • }
  • }
  • function fonc_start()
  • {
  • if(document.getElementById)
  • {
  • document.getElementById("fonc_box1").style.visibility = 'visible'
  • document.getElementById("fonc_box2").style.visibility = 'visible'
  • document.getElementById("fonc_box3").style.visibility = 'visible'
  • document.getElementById("fonc_box1").style.top = fonc_posY-10
  • document.getElementById("fonc_box2").style.top = fonc_posY
  • document.getElementById("fonc_box3").style.top = fonc_posY-10
  • fonc_deplace();
  • }
  • }
  • function fonc_close()
  • {
  • if(document.getElementById)
  • {
  • document.getElementById("fonc_box1").style.visibility = 'hidden'
  • document.getElementById("fonc_box2").style.visibility = 'hidden'
  • document.getElementById("fonc_box3").style.visibility = 'hidden'
  • document.getElementById("fonc_box1").style.top = -600
  • document.getElementById("fonc_box2").style.top = -600
  • document.getElementById("fonc_box3").style.top = -600
  • fonc_deplace();
  • }
  • }
  • window.onload = fonc_start;
  • </SCRIPT>
<SCRIPT language=JavaScript>
versionum = navigator.appVersion.substring(0,1);
if (versionum < 3)
type = false;
else
type = true;
today = new Date;
numero = today.getDate();
if (numero<10)
numero = "0"+numero;
if (type )
annee = today.getFullYear();
else
annee = today.getYear();
listjour = new Array("dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi");
listmois = new Array("janvier","f&eacute;vrier","mars","avril","mai","juin","juillet","aout","septembre","octobre","novembre","d&eacute;cembre");
jour = listjour [ today.getDay()] + " " + numero + " " + listmois [today.getMonth()] + " " + annee;
heure = today.getHours();
minute = today.getMinutes();
seconde = today.getSeconds();
milli = today.getMilliseconds();
if(heure > 1)
pluriel1="s";
else
pluriel1="";
if(minute > 1)
pluriel2="s";
else
pluriel2="";
if(seconde > 1)
pluriel3="s";
else
pluriel3="";
if(heure < 10)
zero1="0";
else
zero1="";
if(minute < 10)
zero2="0";
else
zero2="";
if(seconde < 10)
zero3="0";
else
zero3="";
quelleheure = zero1 + heure + " heure" + pluriel1 + " " + zero2 + minute + " minute" + pluriel2 + " " + zero3 + seconde + " seconde" + pluriel3;

 // PARAMETRES
 var fonc_mess = 'Nous sommes le' ;
 var fonc_mezz = 'et il est'
 var fonc_background = '#000000'
 var fonc_bordure = '#0000FF'
 var fonc_police = 'Arial Rounded MT Bold'
 var fonc_police_taille = '20'
 var fonc_police_color = '#FFFFFF'
 var fonc_hauteur = 137
 var fonc_largeur = 430
 var fonc_box2 = 0;
 
 // CADRES
 fonc_classe = 'border-color:'+fonc_bordure+';border-style:solid;border-width:1px;background:'+fonc_background+';font-family:'+fonc_police+';font-size:'+fonc_police_taille+'px;color:'+fonc_police_color;
 if(document.getElementById)
  {
  document.write('<DIV ID=fonc_box1 STYLE="position:absolute;visibility:hidden;'+fonc_classe+';width:20;height:'+(fonc_hauteur+20)+';z-index:10"></DIV>');
  document.write('<DIV ID=fonc_box2 STYLE="position:absolute;visibility:hidden;'+fonc_classe+';width:'+fonc_box2+';height:'+fonc_hauteur+';z-index:5');
  if(document.all)
  document.write(';padding:10');
  document.write('"></DIV>');
  document.write('<DIV ID=fonc_box3 STYLE="position:absolute;visibility:hidden;'+fonc_classe+';width:20;height:'+(fonc_hauteur+20)+';z-index:10"></DIV>');
  // TAILLE DE L'ECRAN
  fonc_Y = document.body.clientHeight;
  fonc_X = document.body.clientWidth;
  fonc_posX = Math.round(fonc_X/2);
  fonc_posY = Math.round(fonc_Y/2)-Math.round(fonc_hauteur/2);
  }
 
 function fonc_deplace()
  {
  // PLACEMENT
  document.getElementById("fonc_box1").style.left = fonc_posX-20-(fonc_box2/2);
  document.getElementById("fonc_box3").style.left = fonc_posX+(fonc_box2/2);
  document.getElementById("fonc_box2").style.left = fonc_posX-(fonc_box2/2)-5;
  document.getElementById("fonc_box2").style.width = fonc_box2+10;
  fonc_box2 += 5;
  if(fonc_box2<fonc_largeur)
  setTimeout("fonc_deplace()",10);
  else
  {
    document.getElementById("fonc_box2").innerHTML = '<CENTER>'+fonc_mess+'<BR>'+jour+'<BR>'+fonc_mezz+'<BR>'+quelleheure+'<BR><B><A HREF=javascript:fonc_close()><FONT COLOR='+fonc_police_color+'>OK</FONT></A></B></CENTER>'

  }
  }
 
 function fonc_start()
  {
  if(document.getElementById)
  { 
  document.getElementById("fonc_box1").style.visibility = 'visible' 
  document.getElementById("fonc_box2").style.visibility = 'visible' 
  document.getElementById("fonc_box3").style.visibility = 'visible' 
  document.getElementById("fonc_box1").style.top = fonc_posY-10
  document.getElementById("fonc_box2").style.top = fonc_posY
  document.getElementById("fonc_box3").style.top = fonc_posY-10
  fonc_deplace();
  }
  } 
 
 function fonc_close()
  {
  if(document.getElementById)
  { 
  document.getElementById("fonc_box1").style.visibility = 'hidden' 
  document.getElementById("fonc_box2").style.visibility = 'hidden' 
  document.getElementById("fonc_box3").style.visibility = 'hidden' 
  document.getElementById("fonc_box1").style.top = -600
  document.getElementById("fonc_box2").style.top = -600
  document.getElementById("fonc_box3").style.top = -600
  fonc_deplace();
  }
  } 
  
 window.onload = fonc_start;
 </SCRIPT>

 Conclusion

Le script de la popup n'est pas de moi, mais la premiere version de ceette popup est vahement ameliorable.
J'y ai juste ajouté la date et l'heure  intelligente


 Sources du même auteur

DATE ET HEURE EN FRANCAIS AVEC ZEROS SIGNIFICATIS ET PLURIEL...

 Sources de la même categorie

Source avec Zip Source avec une capture POSMOUSE - AFFICHAGE DES COORDONNÉES DE LA SOURIS, TAILLE DE... par phidelum
SFR WIDGET ET JQUERY par hhoareau
Source avec Zip JOLIE ALERTE AVEC "ALERT()" par heycraft
Source avec Zip Source avec une capture FENETRE D'ACTUALITE par kazma
Source avec Zip Source avec une capture CLASS POP-IN AVEC EFFET SOUS JQUERY DE "CONNEXION" STYLE CS ... par Nementon

Commentaires et avis

Commentaire de lolito9311 le 06/03/2011 00:37:42

Bonjour,

Je viens de tester ton code.

Il fonctionne parfaitement dans mon éditeur Dreamviewer, mais lorsque je l'essaie dans le navigatuer IE ou Firefox, il ne fonctionne pas, j'ia une fenêtre en hauteur qui ne fonctionne pas.

Pourrais tu me donner la marche à suivre afin que je puisse l'intégrer dans une page web en html?

J'ai mis le code entre les balises head, et j'ai essayé un petit peu partout dans la page html, mais dans tous les cas ça ne fonctionne pas sur IE et Firefox...

Merci d'avance pour ta réponse.

Cordialement

 Ajouter un commentaire




Nos sponsors


Sondage...

Comparez les prix

CalendriCode

Février 2012
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
272829    

Consulter la suite du CalendriCode

Photothèque

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,764 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales