BullGuard Antivirus Sale - 60% Off with openElement !
Accueil Forum Accueil Forum >

openElement

> Scripts pour votre site
  Nouveaux messages Nouveaux messages Fil RSS  - Script neige qui tombe pour Noël
  FAQ FAQ  Rechercher dans le Forum   Inscription Inscription  Connexion Connexion

Script neige qui tombe pour Noël

 Répondre Répondre Page  <123
Auteur
Message
MicroVinc allez vers le bas
Moderator Group
Moderator Group


Depuis le: 21 Août 2012
Pays: Bretagne
Status: Inactif
Points: 4460
Options des messages Options des messages   Thanks (0) Thanks(0)   Citer MicroVinc Citer  RépondreRéponse Lien Direct à ce Post Envoyé : 13 Dec 2013 à 18:07
Sourire mauvais HI HI Sourire mauvais

<script type="text/javascript">
//Snow on page
var snowmax = 30;
var snowcolor = new Array("#aaaacc", "#ddddFF", "#ccccDD");
var snowtype = new Array("Arial Black", "Arial Narrow", "Times", "Comic Sans MS");
var snowletter = "*";
var sinkspeed = 0.8;
var snowmaxsize = 30;
var snowminsize = 10;
var snowingzone = 1;
var snow = new Array();
var marginbottom;
var marginright;
var ScrollTop;
var timer;
var i_snow = 0;
var x_mv = new Array();
var crds = new Array();
var lftrght = new Array();
var browserinfos = navigator.userAgent;
var ie5 = document.all && document.getElementById && !browserinfos.match(/Opera/);
var ns6 = document.getElementById && !document.all;
var opera = browserinfos.match(/Opera/);
var browserok = ie5 || ns6 || opera;
function randommaker(a) 
{
    rand = Math.floor(a * Math.random());
    return rand
}

function iecompattest()
{
return (document.compatMode && document.compatMode != "BackCompat") ? document.documentElement : document.body 
}

function InitHeight() {
if (ie5 || opera) {
marginbottom = iecompattest().clientHeight + 5; //clientHeight;
marginright = iecompattest().scrollWidth + 5; //clientWidth
}
else {
if (ns6) {
marginbottom = self.innerHeight;
marginright = self.innerWidth
}
}
ScrollTop = document.body.scrollTop;
if (ScrollTop == 0) {
if (window.pageYOffset)
ScrollTop = window.pageYOffset;
else
ScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
}
marginbottom += ScrollTop;
}

function initsnow() 
{
InitHeight()
  var a = snowmaxsize - snowminsize;
  for (oe = 0;oe <= snowmax;oe++) 
{
crds[oe] = 0;
lftrght[oe] = Math.random() * 15;
x_mv[oe] = 0.03 + Math.random() / 10;
snow[oe] = document.getElementById("s" + oe);
snow[oe].style.fontFamily = snowtype[randommaker(snowtype.length)];
snow[oe].size = randommaker(a) + snowminsize;
snow[oe].style.fontSize = snow[oe].size + "px";
snow[oe].style.color = snowcolor[randommaker(snowcolor.length)];
snow[oe].sink = sinkspeed * snow[oe].size / 5;
if (snowingzone == 1) { snow[oe].posx = randommaker(marginright - snow[oe].size) } 
if (snowingzone == 2) { snow[oe].posx = randommaker(marginright / 2 - snow[oe].size) }
if (snowingzone == 3) { snow[oe].posx = randommaker(marginright / 2 - snow[oe].size) + marginright / 4 }
if (snowingzone == 4) { snow[oe].posx = randommaker(marginright / 2 - snow[oe].size) + marginright / 2 }
snow[oe].posy =  randommaker(2 * marginbottom - marginbottom - 2 * snow[oe].size);
snow[oe].style.left = snow[oe].posx + "px";
snow[oe].style.top = snow[oe].posy + "px"
  } 
  movesnow()
}
 
function movesnow() 
{
InitHeight();
for (oe = 0; oe <= snowmax; oe++)
{
crds[oe] += x_mv[oe];
snow[oe].posy += snow[oe].sink;
snow[oe].style.left = snow[oe].posx + lftrght[oe] * Math.sin(crds[oe]) + "px";
snow[oe].style.top = snow[oe].posy + "px";
if (snow[oe].posy >= marginbottom - 2 * snow[oe].size || parseInt(snow[oe].style.left) > (marginright - 3 * lftrght[oe])) 
{
if (snowingzone == 1) { snow[oe].posx = randommaker(marginright - snow[oe].size) }
if (snowingzone == 2) { snow[oe].posx = randommaker(marginright / 2 - snow[oe].size) }
if (snowingzone == 3) { snow[oe].posx = randommaker(marginright / 2 - snow[oe].size) + marginright / 4 }
if (snowingzone == 4) { snow[oe].posx = randommaker(marginright / 2 - snow[oe].size) + marginright / 2 }
snow[oe].posy = ScrollTop 
}
}
var a = setTimeout("movesnow()", 60) 
}
function hidesnow() 
{
if (window.timer) { clearTimeout(timer) }
for (oe = 0;oe <= snowmax;oe++)
document.getElementById("s" + oe).style.visibility = "hidden"
}
}


for (oe = 0;oe <= snowmax;oe++)
{
document.write('<div id="s' + oe + '" style="POSITION: absolute; cursor: Default; Z-INDEX: 100000' + oe + "; VISIBILITY: visible; TOP:-" + snowmaxsize + 'px; LEFT: 15px;">' + snowletter + "</div>")
}
if (browserok)
{ initsnow() } 
else 
  //   document.write('Votre navigateur ne supporte pas ce Javascript')
  };

</script>

Maintenant ça marche avec balises javascript en type html ou OtherScript
ou sans balise javascript en type javascript

Sacré non ! On ne m'aura pas aussi facilement ! Sourire mauvais



Edité par MicroVinc - 13 Dec 2013 à 18:08
-Éléments pour OpenElement : ICI
-Tutoriels pour OpenElement : ICI


La Bretagne, un État dans l'État
Haut de la page
Marmotte28 allez vers le bas
Groupie
Groupie


Depuis le: 27 Mai 2013
Status: Inactif
Points: 75
Options des messages Options des messages   Thanks (0) Thanks(0)   Citer Marmotte28 Citer  RépondreRéponse Lien Direct à ce Post Envoyé : 13 Dec 2013 à 21:20
j'ai bien mis en OtherScript. et j'ai cet affichage
Merci
OE 1.44 r5
Windows 8.1
Chrome
Haut de la page
velocolomiers allez vers le bas
Groupie
Groupie


Depuis le: 12 Nov 2013
Status: Inactif
Points: 54
Options des messages Options des messages   Thanks (0) Thanks(0)   Citer velocolomiers Citer  RépondreRéponse Lien Direct à ce Post Envoyé : 28 Dec 2013 à 17:27
sympa emrci, ça marche bien chez moi Handshake
Le vélo urbain dans le sud ouest de la France: http://velo.colomiers.perso.sfr.fr
Haut de la page
 Répondre Répondre Page  <123
  Partagez ce sujet   

Aller au Forum Permissions du forum allez vers le bas

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

Cette page a été affichée en 0.047 secondes.