...

View Full Version : object + number, possible?



slaskis
08-24-2002, 08:06 PM
I try to make a scrollscript i've found made possible for several
scrolls on one page so i thought maybe i could add a number to
the div/span id and to the function and then it adds it to the
object(or whatever it's called).

example:

function(number) {
object+number.style.pixelTop... bla bla bla...
}

you see my point?
i've tried it (not exactly this script off course, but the "+number"
part) and it doesn't work i've also tried to make "object" an
variable and then there add the number to it like this
var object = object+number;
so please just tell me if this is possible, i really think it should be anyway.


/Robert

joh6nn
08-24-2002, 09:01 PM
function(number) {
window.["object" + number].style.pixelTop... bla bla bla...
}

try that.

slaskis
08-24-2002, 09:20 PM
thanks but i coudn't get it to work i'll could post the whole script later if you would like to help me

slaskis
08-24-2002, 09:29 PM
Oh i'll attach the .js file instead(it's a bit edited)

joh6nn
08-24-2002, 09:32 PM
this:
["data" + number]

has to be this:
window["data" + number]

that should do what you want.

slaskis
08-24-2002, 09:39 PM
hmm thanks now it moves but i still get an error:

'window[...].offsetHeight' is null or not an object

joh6nn
08-24-2002, 10:21 PM
can we see a link to the site this is on?

slaskis
08-24-2002, 10:49 PM
it's not up yet but temporarily try:

http://webb.dynu.com/project

login: forum
pass: pass



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum