Scrolling text to the left JS code effect _javascript Tips

Source: Internet
Author: User

Copy Code code as follows:

<title> scrolling Text effects </title>
<style type= "Text/css" >
#infozone {font-size:12px;color: #aa6; overflow:hidden;width:100px;height:20px;}
#infozone Div{height:20px;line-height:20px;white-space:nowrap;overflow:hidden;}
</style>
<script type= "Text/javascript" >
var TC;
Window.onload=function () {
var O=document.getelementbyid (' Infozone '); HScroll (o);
Window.setinterval (function () {window.cleartimeout (TC); o.firstchild.style.marginleft= ' 0px '; Scrollup (o,20,0);}, 10000);
}
function Scrollup (o,d,c) {
if (d==c) {
var t=o.firstchild.clonenode (true);
O.removechild (O.firstchild); O.appendchild (t);
t.style.margintop=o.firstchild.style.margintop= ' 0px ';
HScroll (o);
}
else{
Ch=false;var s=3,c=c+s,l= (c>=d?c-d:0);
o.firstchild.style.margintop=-c+l+ ' px ';
Window.settimeout (function () {Scrollup (o,d,c-l)},50);
}
}

function HScroll (o) {
var w1=o.firstchild.offsetwidth,w2=o.offsetwidth;
if (W1<=W2) return;
Tc=window.settimeout (function () {HS (O,W1-W2,0,W1-W2)},3500);
}

function HS (O,D,C,P) {
C++;var t= (C>0?-C:C); o.firstchild.style.marginleft=t+ ' px ';
if (C==d) {if (d==0) {tc=window.settimeout (function () {HS (O,P,0,P)},2500);} else Tc=window.settimeout (function () {HS (O,0,-P,P)},3500);}
else Tc=window.settimeout (function () {HS (O,D,C,P)},5);
}
</script>

<body>
<div id= "Infozone" ><div>c# Mouse Properties dynamic operation of related source code examples, such as, hide and display the mouse pointer, the mouse left and right key function interchange, replace the mouse pointer shape, call Windows mouse Settings panel, and so on, little skills, the more the more. </div></div>
</body>
</tr>
</table>

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.