How to set scrolling speed?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
surfinglight
Forum Newbie
Posts: 9
Joined: Wed May 04, 2005 10:04 pm

How to set scrolling speed?

Post by surfinglight »

Hi,

I am coding to read 20 records from a table and show them for scrolling view. Interface has two buttons, "stop" and "start". If "stop" is hit, the scroll stops, and the opposite for "start".

The problem I have is that when this starts initially, scroll speed is too fast. But if stopped, and restarted, the speed adheres to the set value in the code.

Is there any way to make the scroll start initially with the same speed as the set value in the code?

Many thanks in advance.



---- My codes:
$db = mysql_connect("localhost", "user","password");
mysql_select_db("mydb",$db);
$result = mysql_query("SELECT * FROM mytable LIMIT 0,20",$mydb);
echo "<span dir=ltr><marquee id=\"scroller\" direction=\"up\" onMouseover=\"this.scrollAmount=0\" onMouseout=\"this.scrollAmount=1\" >";
while ($myrow = mysql_fetch_array($result)) {
echo $myrow["val1"]." and ".$myrow["val2"]."<br>";
echo $myrow["description"]."<br><br>";
}
echo "</marquee></span></p>";
echo '<a href="javascript:scroller.stop()">Stop</a> | <a href="javascript:scroller.start()">Start</a>';
Corvin Gröning
Forum Newbie
Posts: 16
Joined: Tue May 03, 2005 1:02 pm

Post by Corvin Gröning »

Hi,

you should add some attributes in <marquee>: With scrolldelay you set the speed and with scrollamount you set the step length.
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

marquee is a deprecated tag, you shouldnt even be using it, it could cause problems in the future

My idea would be to do a flash alternative.
Post Reply