Jump to content

Category News Ticker


hybrid kill3r

Recommended Posts

I've come across many useful JS news tickers, but none of them seem to suit my needs. What I am looking for is an "ESPN Style" news ticker. A news ticker that uses categories, or arrays inside arrays.An example of an array would look like this:

var categories = new Array();categories['News'] = new array();categories['News'][0] = "Welcome to the official website!";categories['News'][1] = "The site has been launched...";categories['News'][2] = "Site coming soon...";categories['Events'] = new array();categories['Events'][0] = "Halloween party on Friday October 29th!";categories['Events'][1] = "Christmas Party on Saturday December 18th!";categories['Events'][2] = "New Years party on Friday December 31st!";

I'm not very knowledgeable in JS, but you get the idea. The actual ticker would look something like this:

News | Welcome to the official website!['quote]Basically I want it to scroll through the categories. While it displays the category heading, it should then loop through the messages under the corresponding category. Then when it's finished with the current category, it then scrolls to the next category and displays those messages.Anybody know of any news tickers like this?
Link to comment
Share on other sites

could you just use an object, where each property (category) is an array of news items? Then you can just loop through each array of a categories messages.so your object might look like this:

messagesObj = {  "news"	 :  ["message1", "message2", "message3"],  "events"	 :  ["message1", "message2", "message3"],   //etc};

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...