Jump to content

Marquee text scroll


unplugged_web
 Share

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"?

Edited by thescientist
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...