Graeme Hackston
07-30-2002, 05:07 PM
I've found that I can reduce code by creating a function and calling it when it's required. Like this:
function Div1px10() {
document.getElementById('div1').style.top = "10px";
}
Then I call it like this
if (SomeVar) {
Div1px10();
}
Is there a way to do something like this?
function Div1Top() {
document.getElementById('div1').style.top ;
}
And then call it in another function like this?
if (SomeVar) {
Div1Top() = "20px"
}
I hope this makes sense, thanks for your help.
function Div1px10() {
document.getElementById('div1').style.top = "10px";
}
Then I call it like this
if (SomeVar) {
Div1px10();
}
Is there a way to do something like this?
function Div1Top() {
document.getElementById('div1').style.top ;
}
And then call it in another function like this?
if (SomeVar) {
Div1Top() = "20px"
}
I hope this makes sense, thanks for your help.