JS Horizontal Move Picture

Source: Internet
Author: User

Transverse:

<div id=demo style="overflow:hidden;width:200px;border:2px solid #e0e0e0;padding:2px;"onmouseover="stopscroll();"

onmouseout="doscroll()"> <div id="demo1"style="white-space:nowrap;padding:0;"> <a href="javascript:alert(‘发表新贴‘);">"图片URL"height=20 width=104 border=0></a> <a href="javascript:alert(‘发表回复‘);">"图片URL"height=20 width=104 border=0></a> </div> </div> <!--滚动的javascript--> <script> vart=demo.scrollWidth demo1.innerHTML+=demo1.innerHTML functiondoMarquee() { demo.scrollLeft=demo.scrollLeft<demo.scrollWidth-demo.offsetWidth?demo.scrollLeft+1:t-demo.offsetWidth } function doscroll() {    sc=setInterval(doMarquee,20) } functionstopscroll() {    clearInterval(sc) } doscroll() </script> <!--滚动的javascript结束--> Longitudinal:  <div id="demo"style="height:110px; overflow:hidden ">     <div id="demo1"> <a href="javascript:alert(‘发表新贴‘);">"图片URL"height=20 width=104 border=0></a> <a href="javascript:alert(‘发表回复‘);">"图片URL"height=20 width=104 border=0></a> </div><div id="demo2"></div> <!--滚动的javascript--> <script> var speed=100 demo2.innerHTML=demo1.innerHTML functionMarquees(){ if(demo2.offsetTop-demo.scrollTop<=0) demo.scrollTop-=demo1.offsetHeight else{ demo.scrollTop++ } } varMyMars=setInterval(Marquees,speed) demo.onmouseover=function() { clearInterval(MyMars) } demo.onmouseout=function() { MyMars=setInterval(Marquees,speed) } zlselect(‘6‘); </script><!--滚动的javascript结束--> </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.