winactive
07-09-2003, 10:02 AM
I really tried hard to research this before asking but I don't think it's been asked before :D
What I am looking to achieve is to avoid unnecessary scrollbars when viewing a page in different resolutions. Currently the page(s) in question are within a frame and I used the scrolling=auto property on the frame to make sure the scrollbars only appear when needed.
I have a screen resolution/size sniffing script so detecting the resolution is not a problem, but I have 'top' and 'back' links which use images and are placed near the bottom of the page.
I think DHTML could be used to choose whether or not to display the images (i.e. no 'top' link when the scrollbars are off - or another way; 'top' link only appears when scroll bar is present) but I need to determine how close to the end of the page the 'body' text reaches before deciding whether or not to display the link. Sometimes it is the inclusion of the links which turns the scrollbars on! (Which is what I want to avoid, and the fact that the inclusion of the links and scrollbar in 800x600 can mean they are redundant in 1024x768 - as the text fits in the frame easily because of the extra space).
Absolute references I don't think will work because the amount of space left in the frame will change when the resolution changes.
Basically I am asking if there is a way of detecting the 'length' of the body text by script or it's position on-screen or the amount of space left on the page (pixels or lines of text).
If anyone can make any suggestions, I'd be grateful.
What I am looking to achieve is to avoid unnecessary scrollbars when viewing a page in different resolutions. Currently the page(s) in question are within a frame and I used the scrolling=auto property on the frame to make sure the scrollbars only appear when needed.
I have a screen resolution/size sniffing script so detecting the resolution is not a problem, but I have 'top' and 'back' links which use images and are placed near the bottom of the page.
I think DHTML could be used to choose whether or not to display the images (i.e. no 'top' link when the scrollbars are off - or another way; 'top' link only appears when scroll bar is present) but I need to determine how close to the end of the page the 'body' text reaches before deciding whether or not to display the link. Sometimes it is the inclusion of the links which turns the scrollbars on! (Which is what I want to avoid, and the fact that the inclusion of the links and scrollbar in 800x600 can mean they are redundant in 1024x768 - as the text fits in the frame easily because of the extra space).
Absolute references I don't think will work because the amount of space left in the frame will change when the resolution changes.
Basically I am asking if there is a way of detecting the 'length' of the body text by script or it's position on-screen or the amount of space left on the page (pixels or lines of text).
If anyone can make any suggestions, I'd be grateful.