圖片無縫滾動(div+css)

來源:互聯網
上載者:User

想必大家都注意到<marquee>的不迴圈滾動,所以出現了很多替代指令碼,或iframe或JS輸出<marquee>,不管怎麼做,都略顯麻煩。下面說一下這個相對簡單的實現思路:一個設定寬度並且隱藏超出它寬度的內容的容器demo,裡面放demo1和demo2,demo1是滾動內容,demo2為demo1的直接複製,通過不斷改變demo1的scrollTop或者scrollLeft達到滾動的目的,當滾動至demo1與demo2的交界處時直接跳回初始位置,因為demo1與demo2一樣,所以分不出跳動的瞬間,從而達到“無縫”滾動的目的。
http://hi.baidu.com/cnaspnet/blog/item/52e40c46fcb6af096b63e5bc.html(轉自網路)

相關文章

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.