JS up seamless scrolling, website announcement effect specific code __JS

Source: Internet
Author: User
Tags setinterval

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title> Untitled Document </title>
<style type= "Text/css" >
<!
--#demo
{
Overflow:hidden;
width:220px;
Float:left;
Display:inline;
}
#demo ul
{
Text-align:left;
margin:0px;
padding:0px;
width:220px;
}
#demo ul Li
{
margin-left:5px;
Display:block;
List-style:none;
font-size:13px;
height:26px;
padding-top:5px;
}
--></style>

Unity3d official website http://www.unitymanual.com/
<body>

Here the height of style= "height:26px if not sure, you need to customize the input, otherwise, if the definition of high and UL Li did not reach this height will cause can not scroll
<div id= "Demo" style= "HEIGHT:26PX;" >
<div id= "Demo1" >
<ul>
<li> <a href= "http://www.jb51.net/" > Script House 1</a></li>
<li> <a href= "http://www.jb51.net/" > Script House 2</a></li>
<li> <a href= "http://www.jb51.net/" > Script House 3</a></li>
<li> <a href= "http://www.jb51.net/" > Script House 4</a></li>
</ul>
</div>
<div id= "Demo2" >
</div>

<script type= "Text/javascript" >
Text-free scrolling code, compatible with IE, Firefox, Opera
var speed=60;
var Fgdemo=document.getelementbyid (' demo ');
var Fgdemo1=document.getelementbyid (' Demo1 ');
var Fgdemo2=document.getelementbyid (' Demo2 ');
Fgdemo2.innerhtml=fgdemo1.innerhtml
function Marquee1 () {
if (fgdemo2.offsetheight-fgdemo.scrolltop<=0)
Fgdemo.scrolltop-=fgdemo1.offsetheight
else{
fgdemo.scrolltop++
}
}

var mymar1=setinterval (Marquee1,speed)
Fgdemo.onmouseover=function () {clearinterval (MYMAR1)}
Fgdemo.onmouseout=function () {Mymar1=setinterval (marquee1,speed)}
</script>

</div>
</body>

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.