Native Js to write carousel code

html

css

js

On the basis of knowing how jQuery realizes the carousel effect, write the code in js as shown in the figure

Knowledge used:

1. appendChild() and removeChild() of HTML DOM;

2. CSS transition;

3. Need to understand scope, global variables, life cycle, etc.

4. Two functions setInterval() and setTimeout();

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325161484&siteId=291194637