JavaScript Component: iFrame Scroller

Featuring: Various Scrollers - Continuous Vertical Scroller
Credit:
Dynamic Drive

Dynamic Drive has lots of scrollers and here is one that uses an iFrame as its means of providing scrolling - in this case smooth scrolling capabilities. Also it add the ability to stop the scrolling onMouseOver and restart the scrolling onMouseOut. We have added functionality by increasing the scroll speed with onDblClick and decreasing it with onClick events.
The handy feature of the iFrame Scroller is that the scrolling contents are contained in an external file called externalscroller1.htm. The advantage is that it is simply easier to edit this external file. We have made a change to the externalscroller file- the previously mentioned addition of onClick and onDblClick slowdown and speed up of the scrolling speed. We have also created an external Javascript call on scrolleriframe.js. This makes for faster calls if several iFrame Scrollers are used on subsequent pages. Note as currently coded, there is a limit of one iFrame Scroller per web page.

Again the code for this scroller is fairly simple and the use of an external file makes for easier changes. And with a simple button as above developers can change the contents of the scrolled region. Nifty.
Top of Page  Tutorials Home  JavaScript References  JavaScript Books