Archiv
Ansicht:   
Suche   erweiterte Suche

Nachricht aus dem Archiv

Greenslade schrieb am 20.December.2009, 22:06:01 in der Kategorie web.coding

Kann mir ja jemand Helfen

> Bei diesen js Fliegt Santa übern Bildschirm.
>
> Von links nach rechts oben.
>
> Wie muss das js geändert werden so das er von rechts nach links oben
> Fliegt??
>
> -------------------------------------------
>
>
> function moveSanta() {
> if ( document.getElementById ) {
>
> var left = document.getElementById( \'santa\' ).style.left;
> var top = document.getElementById( \'santa\' ).style.top;
> if ( parseInt( top ) < 150 ) var newyPos = parseInt( top.substring( 0,
> top.length - 2 ) ) - 6;
> else var newyPos = parseInt( top.substring( 0, top.length - 2 ) ) - 2;
> var newxPos = parseInt( left.substring( 0, left.length - 2 ) ) + 10;
>
> document.getElementById( \'santa\' ).style.left = newxPos - \'px\';
> document.getElementById( \'santa\' ).style.top = newyPos - [/b]\'px\';
> if ( newxPos < screen.availWidth ) {
> window.setTimeout(\'moveSanta()\', 80);
> } else {
> document.getElementById( \'santa\' ).style.display = \'none\';
> }
> }
>
> }
> window.setTimeout(\'moveSanta()\', 60);

Ich weiß nicht, ob das reicht aber die beiden Plus sollten auf jeden Fall durch Minus ersetzt werden. Wahrscheinlich mußt Du noch eine andere Startposition angeben.
Archiv
Ansicht:   
Suche   erweiterte Suche
Auf unserer Web-Seite werden Cookies eingesetzt, um diverse Funktionalitäten zu gewährleisten. Hier erfährst du alles zum Datenschutz