New Revised CSS Library Forums Web Tools
FAQs Awards Usage Terms Contact
Categories
Other Sections
Sweet Ads
Compatibility
Bookmark online:

FF1+ IE5+

DOM XMLTicker

Author: Dynamic Drive

Description: By combining DHTML with XML, this ticker script makes updating its contents a breeze, through an external XML file. Just open the file, and enter the desired messages to show. Plain text and links (with targeting) are supported, and script is functional in both IE5+ and NS6+, degrading well with the rest. Now there's little excuse not to update your ticker regularly!

Demo:


Directions Developer's View

Step 1: Insert the below into the <BODY> section of your page, where you wish the ticker to appear:

Select All

Step 2: Download the following xml file, and upload to your webpage directory. It contains the ticker style and contents:

ticker.xml (right click, and select "Save as")

You're essentially done! 

Structure of ticker.xml

In order to update the scroller's contents, you need to familiarize yourself with the structure of ticker.xml, which is straightforward enough:

<?xml version="1.0"?>
<xmlticker>
<pause>3000</pause>
<message>This is message #1</message>
<message url="http://www.cnn.com">This is a link to CNN.com</message>
<message url="http://yahoo.com" target="_new">This is a link to Yahoo</message>
<message>This is message #3</message>
<message>This is message #4</message>
<message>This is message #5</message>
</xmlticker>

The <pause> tag controls the delay between rotation, in milliseconds (3000=3 seconds). All your messages should be added inside their respective <message> tag. To make a particular message a link, insert the "url" attribute inside the tag, and optionally, the "target" attribute.