Using JS to realize the scrolling of banner graph is mainly the application of timer
Create a few pictures of the banner map first, the last one with the first one, to ensure that the rolling uninterrupted
Change the style, you need to note that all the pictures to show in the peer, otherwise you cannot scroll to the left
A function is declared as a timer function, which executes through a switch structure, and the value of case is added by declaring a global variable each time the function is executed, and the number of times the function is executed to determine how far the banner graph is moved to the left. Note that the 5th time you want to zero the global variable to make the switch structure in the timer infinite loop, you can set the transition effect in the style sheet, so that the scrolling more rhythmic
The next step is to achieve the banner click Switch Effect
Start writing functions After you have done your style
Define a parametric function, with different parameters to operate the switch structure, change the banner to the left scroll distance, the bottom of num = Num1-1 is to let the page stop after the click to scroll, but wait for a timer operation after a scroll, Make the banner of the stay show a longer-lasting effect.
The last of the following
How to use JS to implement banner diagram scrolling