[thelist] DHTML - just some code that won't work

jelle desramaults nsg_chong at hotmail.com
Tue Oct 16 06:24:36 CDT 2001


Guys, trying to do some DHTML coding (slide script), I just started working
with objects and referring to objects' property's using "this.whatever".
I need to be able to pass "this" through a Timeout. This is where i run into
trouble. behold my code ...



//--------------------------------------------------------------------------
------------------------------------
function Slide(MaxRight,Value,TimeInterval)
{
var xpos;

xpos = parseInt(this.css.left);

if (StayStatic==1)

{
 if(TimeoutSlideback) clearTimeout(TimeoutSlideback)
 if (xpos < MaxRight)
 {
  xpos += Value
  this.css.left = xpos

// this is the line that matters - this is the line that matters - this is
the line that matters - this is the line that matters

  TimeOutSlide =
setTimeout(this.obj+".Slide("+MaxRight+","+Value+","+TimeInterval+")",TimeIn
terval)

 }
}
}
//--------------------------------------------------------------------------
------------------------------------

the whole thing is at http://www.sitekick.be/testarea/slide_advanced.html

any insight is highly appreciated ( been working on that chunck of code for
2 days!).



<tip type="DHTML" author="Jelle Desramaults">
if you're looking for a good place to start learning cross browser DHTML,
check out http://www.dansteinman.com/dynduo/
</tip>

old news, I know, but that's the only tip I can come up with right now :)

Jelle Desramaults
www.sitekick.be


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.282 / Virus Database: 150 - Release Date: 25/09/01




More information about the thelist mailing list