Home >Web Front-end >JS Tutorial >Product advertising effect based on JQuery_jquery
The effect diagram is as follows:
Animation effect introduction: The effect of this set of advertisements is that the pictures will automatically play after opening the page, a total of 5 pictures from 1-5, if it belongs to the standard Go to the 1, 2, 3, 4, and 5 lists in the lower right corner and you can freely switch to the pictures you want to see. Picture switching is from bottom to top.
Production idea: first put these 5 pictures into the 5 li lists of ul,
《1》find the total number of pictures. And if we are in When you click 1.2.3.4.5, its corresponding number is passed and the corresponding picture is displayed.
《2》If the attribute mark is placed, stop the animation (you can use clearIntval()). If the attribute mark is moved, we can use setIntval(function, time) to execute this function every 3000 milliseconds.
《3》Complete this animation function. In this function, first we can get the height of this animation area (.slider). Then use animate custom animation function to achieve changes in the TOP position. And add a highlighting effect to the numbers in the current li.
《4》One more thing is to make the TOP changes here normally, be sure to set "position:relative;" in the parent tag (.ad) of the current area, and everything will be OK. The production code is as follows:
1》The html structure is as follows: