javascript - Adding and removing a class to a list of divs for creating a content slider -
I am creating a very basic content slider in CSS3 but this question is in relation to its section of jQuery. My content structure is as follows:
& lt; Div class = "slider> There is an ambiguity of 0 in these slides, but when .active is added to the slide, I change the opacity to 1. What I am trying to do is to activate each class in every div for every x seconds . if ($ ('.cl slider'). Length) {// Element var height = $ ('slide.col-md-8') exists. External height (), slide = $ ('slide'), wait = 5000; $ ('Slide'). CSS ('height', height); Slide.each (function () {}); } All this I can come up with. I am sorry if this is not enough, then I also apologize if this is very easy and I am wasting my time only. I have to learn elsewhere I hope that I will not get a vote, I am trying to build my representative with this awesome community of developers.
Collect an example of a script implementing a class with elements in sequence over time, and Threads what can be done in your present.
var i = 1; // counter $ slides = $ ('slides.' .slide '); // Slide array $ num = $ slides.length; // Wait for the number of existing slides = 5000; // Waiting time set interval (function () (// if reached the last slide - reset to the first slide (i ++ == $ num) {$ ('slide'). RemoveClass ('active') ; $ ($ Slide [0]) AddClass ('active'); i = 1;} Other {// Add active slide next active slide $ ('active') RemoveClass ("active") Next () AddClass ('active');}}, wait); // times per slide in // ms
Comments
Post a Comment