DevKB
Web Development Knowledge Base
HOME | TOP 20 | WRITE AN ARTICLE |
Sections :



RSS RSS Feed

You too, please publish your useful code snippets in any programming language :
write an article !


Valid HTML 4.0 Transitional

Plateforme d'envoi de gros fichiers en ligne
Dépannage site web
Blog infogérance
Hébergement e-mail

Olivier Ligny - - 11/03/2008 - vue 5570 fois

Ombre mouvante en DHTML

L'ombre va tourner progressivement comme si la source de lumière bougeait.
Fonctionne sous IE uniquement (utilise un filtre MS).


<div id=test style="padding-left:100; width:100%; font-size:64pt; color:blue;
filter:DropShadow(color=#C0C0C0, offx=3, offy=3.7)">texte</div>

<script>

var offx = 0;
var offy = -5;
var t = 3.14/2;

setInterval("go()",30);

function go() {
    t += .1;
    s = Math.sin(t);
    offx += 3*Math.pow(s,2)*(s<0?-1:1);
    //window.status = offx;
    test.style.filter = "DropShadow(color=#C0C0C0, offx="+offx+", offy="+offy+")";
}

</script>



 




Write a comment :
Your name :     E-mail (optional) :

AntiSpam : what animal is visible on this picture ? :

Nos partenaires : iPhone 8 Cases & Protection