JS text keep scrolling up code

Source: Internet
Author: User
Tags setinterval

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>
&LT;TD width= ">&nbsp;<?=" $vv [' Buy_name ']?></td>
&LT;TD width= "157" >&nbsp;<?=str_replace (substr ($vv [' Buy_tel '],4,-2), ' * * * *, $VV [' Buy_tel '])? ></ Td>
</tr>
</table>
</li>
?
}
}
?>



</ul>
</div>
<div id= "Demo2" ></div>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.