framework7

Open full view…

How to actually implement mySlider.isFirst in an if statement?

Sin
Sat, 17 Jan 2015 08:52:13 GMT

I want to use this to add an animation based off of ".addClass" , "removeClass" if statement based off of which slide the user is on. So for example, if i have 3 total slides, and I start in the middle, when that user slides to the left, I add a class to the container to alter, say, background color. When the user slides back (left) to the middle slide, it displays the already set background. Any ideas? I'm still wrapping my mind around it all

Vladimir Kharlampidi
Sat, 17 Jan 2015 14:57:29 GMT

You need to use it within callbacks: --- var mySlider = app.slider('...', { onSlideChangeStart: function (){ if (mySlider.isFirst) { ... do something ...}; else { ... do something ... } } })