JS text keep scrolling up code
<script type= "text/web Effects" >
<!--
var speed=30; The larger the number, the slower the speed.
var Tab=document.getelementbyid ("demo");
var Tab1=document.getelementbyid ("Demo1");
var Tab2=document.getelementbyid ("Demo2");
tab2.innerhtml=tab1.innerhtml; Clone Demo1 for Demo2
Function Marquee () {
if (tab.scrollheight-tab.scrolltop<=tab.offsetheight)//when scrolling to the junction of Demo1 and Demo2
Tab.scrolltop-=tab1.offsetheight//demo jump to the top
else{
tab.scrolltop++;
}
}
var mymar=setinterval (marquee,speed);
Tab.onmouseo Tutorial Ver=function () {clearinterval (MyMar)};//Remove timer to achieve scrolling stop on mouse move
Tab.onmouseout=function () {mymar=setinterval (marquee,speed)};//Reset timer when mouse is moved
<!---->
</script>
Html
<div id= "Demo1" >
<ul >
?
$db = new db ();
$sql = "Select Buy_tel,buy_name from Tugou where type= ' Jhzsky ' limit 100";
$query = $db->query ($sql);
if ($db->rows ($query))
{
$row = $db->fetch ($query, 0);
foreach ($row as $v => $vv)
{
?>
<li class= "Ctlist" >
<table width= "310" border= "0" cellspacing= "0" cellpadding= "0" align= "left" >
<tr>
<TD width= "> <?=" $vv [' Buy_name ']?></td>
<TD width= "157" > <?=str_replace (substr ($vv [' Buy_tel '],4,-2), ' * * * *, $VV [' Buy_tel '])? ></ Td>
</tr>
</table>
</li>
?
}
}
?>
</ul>
</div>
<div id= "Demo2" ></div>