PDA

View Full Version : page size


benlyboy
05-11-2003, 07:43 AM
I wish to have a box on move between two points on my page. I used "document.body.scrollTop"(IE) and was able to use upper and lower limits to do this, and on my system this works ok. But when up loaded to my host they add a banner and this makes the page (document) longer over all and means that the two points on the page end up higher up.
So I have two questions for you all.
First....is there a way to check the over all length of a page (if I could do this I could have it ajust for any change in length).
Second is there a way to tie it to a point on the page (in the same way as you tie in content using a table in html)

you can see the page i am working on at http://grahamshondabenlypage.freewebsitehosting.com/partsbook1.html

you will see how with the banners to box now goes to high on the page

Graeme Hackston
05-11-2003, 08:36 PM
1/ document.body.scrollHeight

2/ (if I understand you)

document.getElementById('myelement').style.top = document.getElementById('otherelement').offsetTop + 'px'
document.getElementById('myelement').style.left = document.getElementById('otherelement').offsetLeft + 'px'

benlyboy
05-12-2003, 08:11 AM
Thanks Graeme
Have made the change to my test page, using the info you gave me and it works just great....

Can't thank you enough ...your the man....lol

and maybe this post will help someone else....:D

Graeme Hackston
05-12-2003, 03:19 PM
Glad it worked for you.

You might want to think about changing your positionit() function to something that uses the css property "fixed". It makes for perfectly smooth scrolling.

IE hasn't implemented it yet but the new NN browsers have. Maybe IE7 will implement it. Have a look at this page with a new NN browser.

http://www.mark.ac/help/sticky.html