Accueil > > > 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
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évrier","mars","avril","mai","juin","juillet","aout","septembre","octobre","novembre","dé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évrier","mars","avril","mai","juin","juillet","aout","septembre","octobre","novembre","dé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
Sources de la même categorie
Commentaires et avis
|
Derniers Blogs
TECHDAYS PARIS 2010 : SHAREPOINT 2010 POUR LES DéVELOPPEURSTECHDAYS PARIS 2010 : SHAREPOINT 2010 POUR LES DéVELOPPEURS par ROMELARD Fabrice
Animé par: Laurent Cotton Le développement dans SharePoint 2010 passe par plusieurs axes qui seront évoqués dans cette session, mais plus particulièrement les développements simples lié au besoin Business Business Connectivity Services Ce BCS es...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice TECHDAYS PARIS 2010 : PLEINIèRE DERNIER JOURTECHDAYS PARIS 2010 : PLEINIèRE DERNIER JOUR par ROMELARD Fabrice
Cette session est la dernière pleinière de ces 3 jours de TechDays Paris 2010. Généralement, cette troisième journée est plus axée sur l'avenir vu par Microsoft. Après un retour sur l'avenir vu par la Science Fiction ou par ...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice UNE JOLIE-HORLOGE ET PAS QU'UN PEU !UNE JOLIE-HORLOGE ET PAS QU'UN PEU ! par neodante
Pour les possesseurs d'iPhone, ça y est Bijin Tokei - qui se traduit littéralement en Français par " Jolie Horloge " - est arrivé et GRATUITEMENT s'il vous plaît ! Après la version Tokyo, Hokkaido, night club, racing, Gal, "pour les mademoiselles'", . voi...
Cliquez pour lire la suite de l'article par neodante TECHDAYS PARIS 2010 : CONNECTEZ VOS DONNéES à SHAREPOINT 2010 AVEC LES BUSINESS CONNECTIVITY SERVICESTECHDAYS PARIS 2010 : CONNECTEZ VOS DONNéES à SHAREPOINT 2010 AVEC LES BUSINESS CONNECTIVITY SERVICES par ROMELARD Fabrice
Animé par: Gaetan Bouveret et Julien Chomarat Business Connectivity Services (BCS) est dans SharePoint 2010 la version 2 de Business Data Catalog (BDC dans SharePoint 2007). Il s'agit de la solution permettant de visualiser des données provenan...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice [DIVERS] SUIVRE VOS SéRIES PRéFéRéS SUR LA TOILE[DIVERS] SUIVRE VOS SéRIES PRéFéRéS SUR LA TOILE par orion
Comme de nombreux geek, je suis un grand amateur de série TV et je rate régulièrement des épisodes de mes séries préférés. Une solution s'offre à vous avec ce merveilleux site : Tv Gorge - www.tvgorge.com Moteur de recherche à l'appui, vous pouvez ...
Cliquez pour lire la suite de l'article par orion
Logiciels
DB-MAIN (9.1.0)DB-MAIN (9.1.0)DB-MAIN is a data-modeling and data-architecture tool. It is designed to help developers and anal... Cliquez pour télécharger DB-MAIN Xilisoft DPG Convertisseur (5.1.37.0120)XILISOFT DPG CONVERTISSEUR (5.1.37.0120)Xilisoft DPG Convertisseur offre aux fans de Nintendo DS une bonne solution leur permettant de dé... Cliquez pour télécharger Xilisoft DPG Convertisseur GraphicsGale (2.01.01)GRAPHICSGALE (2.01.01)GraphicsGale est un logiciel de PixelArt avec de nombreuse fonctionnalités permettant de réalisé ... Cliquez pour télécharger GraphicsGale Architecte 3D (Platinum 2010)ARCHITECTE 3D (PLATINUM 2010)Architecte 3D Platinium vous permet de concevoir facilement les plans votre future maison, de l'é... Cliquez pour télécharger Architecte 3D TeamViewer 5 (TeamViewer 5)TEAMVIEWER 5 (TEAMVIEWER 5)Dépanner un ami,expliquer une manipulation devient un jeu d'enfant.
Prise en main d'un autre ord... Cliquez pour télécharger TeamViewer 5
|