

|
| | Create a Scrolling News Ticker in JavaScript
|
| |
This document describes how to Create a Scrolling News Ticker in JavaScript. The script is compatible with both Internet Explorer 5.x or later (IE) and FireFox (FF).
Scrolling News Ticker You can add this ticker in your own web pages.
Free You can add it for free, in exchange of a link to this page.
Desktop News Ticker And why not to offer to your visitors your own Desktop News Ticker? This is the perfect tool to attract and keep visitors... More info
You can add this scrolling news ticker with your own text in your web pages.
Features:
Easy to embed into an HTML document;
Compatible with Internet Explorer and FireFox;
Full JavaScript: no plugin, no Java, no ActiveX;
Supports full HTML, including images, links and any other tags;
Smooth scrolling;
Very small script - fast to download;
Easy to customize;
Free for personal and commercial use.
If you want a downloadable Desktop News Ticker instead of or in addition to your web based scrolling ticker:
How to create a Desktop News Ticker
Desktop News Ticker Solution
|
Free News Ticker in JavaScript for web site
| |
The script is free for personal and commercial use. We would appreciate a small text/links to be displayed in the pages where the ticker is shown:
Scrolling News Ticker by Mioplanet
< Get HTML Code
|
The News Ticker JavaScript Code
| |
The JavaScript source code for the scrolling ticker is stored in a .js file - download (zip - 0,7 Kb).
To include a ticker in an HTML document, put the .js file in the same folder than your HTML document and add the following code where you want the ticker to be visible:
If you want the scrolling to stop when the mouse is over it, try this code instead:
Here is an HTML document displaying the scrolling ticker:
|
Setting Options in the JavaScript Source Code
| |
You can edit the file webticker_lib.js and change the values for the following variables:
TICKER_RIGHTTOLEFT
Set to true if the text is in Arabic, Hebrew or other right-to-left writing language.
TICKER_SPEED
Set the scrolling speed. Default value is 2.
TICKER_STYLE
Set the default style for the scrolling text.
TICKER_PAUSED
When this variable is set to true, the scrolling ticker is paused.
This value can be changed at runtime, for example when the mouse is over the ticker.
|
RSS or XML Data Source
| |
The scrolling text can be imported from any source: RSS, XML or any other format.
For example, if you want to import data using PHP to convert it into a single HTML line to be displayed by the ticker, create a php script to import and convert the data, and include it directly in the DIV tag as follow:
|
Resources
|