Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: scrollTop in integer and top in px


Message #1 by "Tim Huang" <timhuang@m...> on Tue, 20 Nov 2001 16:44:40
Just place the "px" in the expression...

As in:

top:expression((document.body.scrollTop + 'px'))


<div style="position:absolute; top:expression((document.body.scrollTop +
'px'))">The div</div>



/Robert



-----Original Message-----
From: Tim Huang [mailto:timhuang@m...] 
Sent: den 20 november 2001 17:45
To: javascript
Subject: [javascript] scrollTop in integer and top in px


I was trying to make the top property of a certain div relatively to body's 
scrollTop value. Here's what I did:

top:expression(document.body.scrollTop)

But later I found out that scrollTop has a value of integer, while top will
also 
has value in px. How do I transform scrollTop from integer into px??

  Return to Index