Quackit Logo
HTML
CSS
Scripting
Database
Hosting
Design
XML

JavaScript Scroll

This page contains code that you can use to create a JavaScript scroll. This is a JavaScript marquee that displays scrolling text. The text scrolls in any direction you need; horizontally (from right to left, left to right), or vertically (down to up, or up to down). The JavaScript scroll was originally created by Netscape and is distributed using the Mozilla Public License. It should work on most browsers.

This JavaScript scrolling script comes in two parts: The first part is an external .js file, which contains the scrolling text code. The second part is the customizable part, where you enter your own parameters.

Here are some samples, just to get you started.

Instructions

First of all, download xbMarquee.js.

If you prefer not to download the file, you can copy/paste the contents into a file (see bottom of this article).

Once you've done that, you can use any of the following codes to display your JavaScript scroller. These codes simply provide the parameters for the xbMarquee.js file. These parameters determine things such as the scroll direction, the text to scroll, the speed of the marquee etc. You only need to reference xbMarquee.js once on any page that uses the code (regardless of how many marquees are on that page).

Right to Left

This marquee scrolls from right to left.

Example:

CodeResult

Left to Right

This text scrolls from left to right.

Example:

CodeResult

Faster

This text scrolls from right to left, but much faster than the previous examples.

Example:

CodeResult

Scrolling Up

This text scrolls upwards. The height of the marquee has changed too - from 19px to 100%.

Example:

CodeResult

Scrolling Down

This text scrolls downwards.

Example:

CodeResult

Contents of xbMarquee.js

Below are the full contents of xbMarquee.js. You will need this for the above marquee examples to work.

Code

Enjoy this page?

  1. Link to this page (copy/paste into your own website or blog):
  2. Link to Quackit using one of these banner ads.

Thanks for supporting Quackit!

Sponsored Link: Design CODE-FREE Websites