We have noticed that marquee does not scroll cyclically, so there are many alternative scripts. Next we will introduce them in detail: scroll to the left. scroll to the left. Scroll down the image seamlessly. So there are a lot of alternative scripts, or iframe or JS output. No matter how you do it, it is a little troublesome. The following is a simple implementation concept: A container demo that sets the width and hides content beyond its width. demo1 and demo2 are included in the demo, and demo1 is the scrolling content, demo2 is a direct clone of demo1. By constantly changing the scrollTop or scrollLeft of demo1 to scroll, the original position is directly jumped back when rolling to the junction of demo1 and demo2 because demo1 is the same as demo2, therefore, we can't tell the beat moment to achieve the goal of "seamless" rolling.
Some modifications have been made based on the original author, mainly in the style above, replace the table with a label. And standardize JavaScript to run in all browsers.
First, let's take a look at several attributes of the object: innerHTML: set or obtain the HTML scrollHeight located in the start and end labels of the object: get the scroll height of the object.
ScrollLeft: sets or obtains the scrollTop distance between the left edge of the object and the leftmost end of the currently visible content in the window: set or get the scrollWidth between the top of the object and the top of the visible content in the window: get the scroll width of the object offsetHeight: obtain the height of an object relative to the layout or the height of the parent coordinate specified by the parent coordinate offsetParent attribute offsetLeft: Obtain the left position of the object relative to the layout or the parent coordinate specified by the offsetParent attribute offsetTop: obtains the top position of an object relative to the layout or the parent coordinate specified by the offsetTop attribute. offsetWidth: obtains the width of the object relative to the layout or the parent coordinate specified by the parent coordinate offsetParent attribute.
The Code is as follows:
Seamless Scrolling on Images
Scroll up
Script
Script
Seamless scrolling under images
Scroll down
Script
Script
Seamless left scrolling
Scroll left
Script
Script
Seamless Scrolling on the right
Scroll to the right
Script
Script