-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pagination #33
Comments
You'd have to implement this feature in your UI yourself. Swipe exposes a simple API that your can use. You could create a function, say function updateNumbering(swipeInstance, elem) {
// reference to the Swipe API
var currentIndex = swipeInstance.getPos();
// now populate your UI however you want with the new index
elem.innerHTML = currentIndex;
} Then you would tie your update function with your Swipe instance. Note that the function declaration may be placed below your instantiation code. Assuming you have // 1) run at slide change
window.mySwipe = new Swipe(swipeElem, {
// options...
transitionEnd: function() {
updateNumbering(mySwipe, myNumberingElement);
}
}
// 2) run on page load
// note that you must first define `mySwipe`, above the line below
updateNumbering(mySwipe, myNumberingElement); Lastly, if you want to add the total (e.g. the number |
I beg you to help me, I myself can not. I insert this code, but the slider stops working. I apologize for the broken English, I do not know much English. Thank you for your help. |
Does your console output any errors? |
No, no console errors. But when I insert the code, the slider does not show, just empty space. Please tell me you could put somewhere modified code? I will be very grateful. |
Did you replace the variables in the snippet above with your proper context? |
I wrote a pen with a working example using the demo as a test case. It should work, as long as you implement it in your project (you can't just copy-paste the snippet above). I'll close this for now as it isn't really an issue, but a user question (which could be asked on a user forum like Stack Overflow for example). |
Excuse me for my long answer. Yes, I did, I have all happened because of you. You helped me a lot. Thank you very much. Wish you luck. Sorry for my agliyskom, I do not know much English. I'm from Russia. And thank you for your patience, for your help and for your kindness. |
No problem, don't hesitate getting in touch if you need anything else! 😄 |
Good! Thank you, thank you, thank you! Good luck! :) |
How to add numbering? For example, 3/7
Thank you!
The text was updated successfully, but these errors were encountered: