Closed Thread Icon

Topic awaiting preservation: can someone please help (Page 1 of 1) Pages that link to <a href="http://ozoneasylum.com/backlink?for=8414" title="Pages that link to Topic awaiting preservation: can someone please help (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: can someone please help <span class="small">(Page 1 of 1)</span>\

 
quisja
Paranoid (IV) Inmate

From: everywhere
Insane since: Jun 2002

posted posted 11-28-2002 17:13

ok, i'm fairly new to javascript as such, but using my visual basic knowledge and some snippets from the net managed to hack together this script to slideout a menu from the side of the screen when a function is called. there are two problems though. firstly, because of something to do with the timer i can't get the thing to slide back to where it came from (it just jerks left then back again, and i've tried clearTimeout but can't seem to get that working), and what's more it doesn't work at all in mozilla. i would much appreciate it if someone would explain why. thanx.

objectLeftPos = -100;
Tymer = null;

function moveRight() {
if (document.all) {object = object1.style}
if (document.layers) {object = document.object1}
if (objectLeftPos < 100) {
objectLeftPos += 5;
object.left = objectLeftPos;
Tymer = setTimeout("moveRight()",10)
}
}

function moveLeft() {
if (document.all) {object = object1.style}
if (document.layers) {object = document.object1}
if (objectLeftPos > -100) {
objectLeftPos = objectLeftPos-5;
object.left = objectLeftPos;
Tymer = setTimeout("moveRight()",10);
}
}

EDIT: I fixed the cross browser problem with document.getelementbyid etc.




[This message has been edited by quisja (edited 11-28-2002).]

poi
Paranoid (IV) Inmate

From: France
Insane since: Jun 2002

posted posted 11-28-2002 17:39

in the function moveLeft, replace the
Tymer = setTimeout("moveRight()",10);
by
Tymer = setTimeout("moveLeft()",10);

BTW, either you use the Tymer somewhere else, you don't need to retrieve the Timeout handle.
Best regards,



Mathieu "POÏ" HENRI

quisja
Paranoid (IV) Inmate

From: everywhere
Insane since: Jun 2002

posted posted 11-28-2002 17:54

Comfound whoever invented copy/cut/paste. And thank you kindly. Much appreciated. It isn't really fully working/finished yet but you can go see it at: http://quis.coolfreepage.com/test.php

« BackwardsOnwards »

Show Forum Drop Down Menu