Jump to content

Marquee text scroll


unplugged_web

Recommended Posts

I wonder if anybody can help me please. I want to use <MARQUEE>, but want it to alternate the text it scrolls. Some text comes from a database other text is just plain text. But other than just putting the text in myself and then adding spaces is there anyway I can get it to display different sentences randomly.For example I'm currently using:

<marquee width="570px" loop="50" direction="left" scrollamount="4" onMouseOut="this.start()" onMouseOver="this.stop()" bgcolor="#000000"><?php echo $row['news']  ?>     Get your latest news     Breaking news     Archive news</marquee>

But in an idea world I'll like to randomly display the text.Thanks

Link to comment
Share on other sites

you would probably need some sort of Javascript function to randomly pick text, maybe with setInterval, you have pre-determined, and then maybe use it conjunction with AJAX to "refresh" the page so the text changes based on what the javascript function has "picked"?

Link to comment
Share on other sites

Isn't <marquee> deprecated?
No, it's not deprecated. An element can only have been deprecated if it was a standard to begin with. <marquee> was never even a web standard.
Link to comment
Share on other sites

you would probably need some sort of Javascript function to randomly pick text, maybe with setInterval, you have pre-determined, and then maybe use it conjunction with AJAX to "refresh" the page so the text changes based on what the javascript function has "picked"?
Thanks, I'll give that a go.
Link to comment
Share on other sites

There are numerous JavaScript alternatives available on the web to replace <MARQUEE> that will work in most of the browsers that don't support it.If the text is in a db then you might be better coding the main part of the page with ASP or some other language (depending upon what is supported by your Internet Server),

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...