Download Scrollable div

Demo

Remember a strict doctype

A strict doctype is your biggest ensurance for this script to look and work the same across different browsers

Put this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
at the top of your HTML file

Put this into your <HEAD> section

Put this into your <BODY> section

Copy these two images into a folder called "images"

Right click on the arrows and choose "Save target As". If you want to, you could replace these two images with your own version

Implementation

Content

Put the content you want to scroll right below the line <!-- PUT YOUR HTML CONTENT IN HERE --> in the code

Javascript configuration

Use these javascript methods to configure the script:

  1. scrolldiv_setColor(rgbColor) - Specify a new border color
  2. setSliderBgColor(rgbColor) - Specify a background color for the scrollbar
  3. setContentBgColor(rgbColor) - Specify a background color for the scrolling content
  4. setScrollButtonSpeed(newSpeed) - Increase the scrolling speed(Default = 1)
  5. setScrollTimer(newInterval) - Lower value = faster scrolling(Default = 10)
  6. scrolldiv_setWidth(newWidth) - Specify a new width
  7. scrolldiv_setHeight(newHeight) - Specify a new height
  8. scrolldiv_initScroll() - Initializing the scrolling div. The functions above are optional, this one is needed for the script to work

For further information, see how these functions are used in the code.

Comments

No one has commented this - be first!

Post your comment

Don't have an avatar? Create one at Gravatar.com.

Confirmation code:

Go to cbolson.com


About/Contact | A good idea? | Submit a script | Privacy notice
© 2005 - 2024 dhtmlgoodies.com