You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there currently no way of getting the splide object inside an event? I'm changing a number inside the splide element every time it is moved for multiple splide instances on my page. I had to resort to going through all the splides and comparing indexes. Could be so much simpler if I could just access the object directly.
note: splides array is composed of splide objects
splides[i].on( 'moved', function (newIndex) {
for ( var i = 0; i < splides.length; i++ ) {
if (newIndex === splides[i].index){
$(splides[i].root).find('.splide__current_slide_nr').text(Math.ceil(newIndex / splides[i].options.perPage) + 1);
}
}
} );
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Is there currently no way of getting the splide object inside an event? I'm changing a number inside the splide element every time it is moved for multiple splide instances on my page. I had to resort to going through all the splides and comparing indexes. Could be so much simpler if I could just access the object directly.
note: splides array is composed of splide objects
While this would look much prettier:
or even:
Beta Was this translation helpful? Give feedback.
All reactions