RoyW
08-02-2006, 03:02 AM
1) CODE TITLE:
Keep In View
2) AUTHOR NAME/NOTES:
Roy Whittle
This script will keep almost any html element in view even if the user scrolls the browser window.
It is a re-write of the float menu code. Now we (js coders) don't have to consider netscape 4 it makes the code a lot simpler. It also solves problems that users have asked for. How do align center, how do I keep it in the left/right of a table column, how can I make it not scroll untill it is going off the screen.
I have tested the code in various browers, with various doctype settings, floating various HTML elements(table, td, tr, img, div, span) but due to the possible combinations I cannot test all. You could simply state that all "Keep In View" elements must be in div's.
I have coded it so all the user has to do is give the element an "id" of "jsfx_float<x>" where x=0 to 3. The code can easily be changed to let the user specify the "id" of the element that needs to float.
3) DESCRIPTION:
Using this script you can keep any html element in view when the user scrolls the browser window. Simply give the element an id of jsfx_float0, jsfx_float1, jsfx_float2, jsfx_float3, then cut and paste the script just before the closing body tag </body>
4) URL TO CODE:
Keep In View (http://www.jsfx.com/submitscripts/float2/index.html)
P.S.
If javascript is disabled then the page should layout as normal but the elelemnts will simply not float.
Keep In View
2) AUTHOR NAME/NOTES:
Roy Whittle
This script will keep almost any html element in view even if the user scrolls the browser window.
It is a re-write of the float menu code. Now we (js coders) don't have to consider netscape 4 it makes the code a lot simpler. It also solves problems that users have asked for. How do align center, how do I keep it in the left/right of a table column, how can I make it not scroll untill it is going off the screen.
I have tested the code in various browers, with various doctype settings, floating various HTML elements(table, td, tr, img, div, span) but due to the possible combinations I cannot test all. You could simply state that all "Keep In View" elements must be in div's.
I have coded it so all the user has to do is give the element an "id" of "jsfx_float<x>" where x=0 to 3. The code can easily be changed to let the user specify the "id" of the element that needs to float.
3) DESCRIPTION:
Using this script you can keep any html element in view when the user scrolls the browser window. Simply give the element an id of jsfx_float0, jsfx_float1, jsfx_float2, jsfx_float3, then cut and paste the script just before the closing body tag </body>
4) URL TO CODE:
Keep In View (http://www.jsfx.com/submitscripts/float2/index.html)
P.S.
If javascript is disabled then the page should layout as normal but the elelemnts will simply not float.