Page 1 of 1

How to set scrolling speed?

Posted: Wed May 04, 2005 10:05 pm
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>';

Posted: Thu May 05, 2005 2:42 am
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.

Posted: Thu May 05, 2005 3:43 am
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.