This article mainly introduces how native js achieves image carousel special effects and is suitable for product display to achieve the simplest advertising carousel effect, interested friends can refer to this article to summarize the code for Implementing Image carousel special effects in native js and share it with you for your reference. You are welcome to learn.
Run:
Code:
Simplest carousel Advertisement
Script var box = document. getElementById ('box'); var uls = document. getElementsByTagName ('ul '); var imgs = uls [0]. getElementsByTagName ('lil'); var btn = uls [1]. getElementsByTagName ('lil'); var I = index = 0; // The intermediate quantity. It is declared in a unified manner; var play = null; console. log (box, uls, imgs, btn); // get the correct result // switch the image. I used (transition: opacity 0.8 s linear) to fade in and out the results, the function show (a) {// method in css defines the response of buttons and images when a lower mark is passed in. for (I = 0; I
I hope this article will help you learn about javascript programming.