Possible, yes. How much is your client willing to pay for this? Anyways, one would start with or create a scrolling type thing (many free examples of which are in the DD script library and elsewhere on the web). Now, some of these type scripts work off of an array of entries. This array could be made multidimensional and an entry in each entry's array could be the expiration date. Those that have expired could be culled using a test against the current date (either on the server or user's machine), prior to the array's use by the rest of the script to populate the scroller. Example of plain array to populate a scroller (from Pausing up-down message scroller):
Code:
//configure the below variable to change the contents of the scroller
var messages=new Array()
messages[0]="<font face='Arial'><a href='http://www.dynamicdrive.com'>Click here to go back to Dynamicdrive.com frontpage</a></font>"
messages[1]="<font face='Arial'><a href='http://javascriptkit.com'>Visit JavaScriptKit for award winning JavaScript tutorials</a></font>"
messages[2]="<font face='Arial'><a href='http://www.codingforums.com'>Get help on scripting and web development. Visit CodingForums.com!</a></font>"
messages[3]="<font face='Arial'><a href='http://www.freewarejava.com'>Looking for Free Java applets? Visit Freewarejava.com!</a></font>"
messages[4]="<font face='Arial'><a href='http://dynamicdrive.com/link.htm'>If you find this script useful, please click here to link back to Dynamic Drive!</a></font>"
Now the array can be made multidimensional using this technique (additions red):
Code:
messages[0]=["<font face='Arial'><a href='http://www.dynamicdrive.com'>Click here to go back to Dynamicdrive.com frontpage</a></font>", "5/25/2006"]
With that change, everywhere in the script that used to use messages[0] (messages[x]), for the content of the message would now need to use messages[0][0] (messages[x][0]), and so on for the rest of the entries. An expiration date can be set for each entry (an empty field could be used for no expiration, but would have to be tested for as well as the date then). To add entries is simple, they just get tacked onto the end of the array and to remove entries before displaying them, if they have expired, can be accomplished by testing messages[x][1] against the current date and using the splice() method, removing them before populating the scroller. It would be a good idea to periodically remove expired entries but, this could be done at one's leisure. Entries would need to maintain consecutive number sequence (when added and especially when removed) for the array to be valid for use by the script.
Bookmarks