Last time a carousel was written: http://blog.csdn.net/stronglyh/article/details/46833499
Because people asked me when, gave me HTML, so I saw the page quoted jquery, so I wrote with jquery, today, I think of a addclass in jquery, do not know whether the traditional JS can be used to fix it.
Where the splice method was used when deleting
For this method, there are a total of three more commonly used usage, explained in detail below:
1. Delete-Used to delete elements, two parameters, first parameter (to remove the position of the first item), second parameter (number of items to delete)
2. Insert-Inserts any item element into the specified position in the array. Three parameters, first parameter (in fact position), second argument (0), third parameter (inserted item)
3. Replace-Inserts any item element at the specified position in the array, deleting any number of items, three parameters. First parameter (start position), second parameter (number of items deleted), third parameter (insert any number of items)
So now everyone should know how to use it, and suddenly found that jquery is more convenient ah.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
JS----Array processing splice (with JS primitive AddClass method OH)