Here's the page.
In short, I wrote primitive panel sliding script, now i want to incapsulate it into an object. Of course it requires a lot of styling and bugfixes, it's just what I threw in quickly.
the thing that concerns me is the way I call setTimeout.
sl is a global variable storing the object, and of course, i want to get rid of it cause object is pointless with this kind of code.
even if I will get rid of the counter and use heights themselves to found the stage of the slide, it's all still blurred.
How do i set timeout for the object method?
If I try using 'slide' or 'this.slide' (in quotes) it doesn't work,
if i try anything without quotation marks and with () browsers just call function recursively to get the string.
if i add function name (this.slide) without ()-s, hoping that it will act as function pointer, IE says it misses "(" and Firefox just does nothing.
I see at least two possible workarounds, pass variable name to the constructor (definitely not good) and passing all the required stuff to slide as params, settimeouting it as 'Slider.prototype.slide('+this.p1+.... (not good).
Are there any right ways?
In short, I wrote primitive panel sliding script, now i want to incapsulate it into an object. Of course it requires a lot of styling and bugfixes, it's just what I threw in quickly.
the thing that concerns me is the way I call setTimeout.
Code:
setTimeout('sl.slide('+i+')',30);
even if I will get rid of the counter and use heights themselves to found the stage of the slide, it's all still blurred.
How do i set timeout for the object method?
If I try using 'slide' or 'this.slide' (in quotes) it doesn't work,
if i try anything without quotation marks and with () browsers just call function recursively to get the string.
if i add function name (this.slide) without ()-s, hoping that it will act as function pointer, IE says it misses "(" and Firefox just does nothing.
I see at least two possible workarounds, pass variable name to the constructor (definitely not good) and passing all the required stuff to slide as params, settimeouting it as 'Slider.prototype.slide('+this.p1+.... (not good).
Are there any right ways?