Ruler
September 12th, 2002, 04:34 PM
I have written a script that moves a navbar at the side of my web-site.
I have multiple layers with links on and it moves the layers to show the relavent links and the nav-bar slides in and out with a nice little sound.
The problem is that the code will be very long if i complete with out variables in it and i dont know how to use the variables in the function arguement. Also i dont know if what i am trying to do is possible.
I want to use a function arguement instead of a layer name. So as follows.
I currently have:
fucntion moveout() {
<code>
document.all.Services.style.posLeft = 72;
<code>
}
Is it possible to have:
fucntion moveout(<Layer>) {
<code>
document.all.<layer>.style.posLeft = 72;
<code>
}
If so how? PLease help.
Cheers
-Ruler-
I have multiple layers with links on and it moves the layers to show the relavent links and the nav-bar slides in and out with a nice little sound.
The problem is that the code will be very long if i complete with out variables in it and i dont know how to use the variables in the function arguement. Also i dont know if what i am trying to do is possible.
I want to use a function arguement instead of a layer name. So as follows.
I currently have:
fucntion moveout() {
<code>
document.all.Services.style.posLeft = 72;
<code>
}
Is it possible to have:
fucntion moveout(<Layer>) {
<code>
document.all.<layer>.style.posLeft = 72;
<code>
}
If so how? PLease help.
Cheers
-Ruler-