Comments (10)
Yea the transition end function doesn't fire if you begin transitioning again before its complete, which makes sense I guess. A possible solution could be to provide another callback that fires on change of slide?
Do you have a specific use case that needs a change of slide callback every time?
from swipe.
Yeah that would work.
I'm using swipe to make a paged result set. So basically I load a dataset and render a subset e.g 10 pages worth of data, render 3 pages of data and as the user swipes to the next page I pre-render the next page ready for when they swipe. So I need to know every time there is a slide.
I currently calculate if it is a forward or back slide too, might be nice to have this as part of the callback params or something?
Saying that, the simplicity of the script is it's strength so I wouldn't want to clog it up with unneeded functionality. Nice work btw!
from swipe.
owilliams, is the paged result set logic you mentioned above available as public code anywhere? I need something similar and haven't found a good example using Swipe.
from swipe.
I'm afraid it's not, it's part of a commercial product. It has some other dependancies on other libraries too (mainly backbone) and isn't very standalone at the moment. I may be able to make it available at some point, but not any time soon I'm afraid.
If you want any pointers then fire me a message.
from swipe.
Understood - thanks for the reply!
from swipe.
Fellas,
What if I make a second callback in the library, like pre-animation? It would fire when any movement has been determined to be a valid swipe to a next, prev slide. Let me know your thoughts.
from swipe.
Yeah that should work. I guess you'd need to rename the callback options to be more descriptive too.
It could be argued though that transition end callback isn't needed if you're able to add your own transitionend
listener on the element?
from swipe.
Yea, I also using this swipe to get paginated pay-slip kind of HR app. For example, on initial children I have 12 months of payslips for year 2011, then when the guy swipe to almost the end like in Feb 2011, I will want to remote load the previous years additional 12 months of payslips for year 2010.
Right now the children detection is not "live" if I am not wrong. Is there a way to make use of delegation a.k.a the jQuery's live way of detecting children?
from swipe.
Swipe2 will have a callback function (immediately after the swipe) and a transitionEnd function (after animation) :)
Feel free to start testing it out here
from swipe.
Thanks for this :)
from swipe.
Related Issues (20)
- Which Swipe library should cdnjs host and autumatically update the repo
- How to display a partial view of the next slide? HOT 4
- 当只有两个滑动卡时,下滑出现bug
- How to adjust the height according to their own height when it is used for the whole page tab?
- i want text alert on click prev or next button...? HOT 1
- When i append div on document ready, My style is not applying. HOT 2
- Show multiple slides HOT 3
- Webpack 2 pull Jquery
- Ipad, iphione scroll problem
- vertical slides?
- Width calculation rounding - Edge browser
- Gaps between each slider item in latest Safari HOT 2
- FEATURE REQUEST: Run callback only if it’s on touch and not by function HOT 1
- Swipe does not work android mobile browser.
- Processing version of Swipe
- 切换后如何自动播放
- 调用slide方法后,自动滑动失效 HOT 1
- Pagination buttons and slideTo method go to a wrong slide.
- Extra space on left
- Can I use it with vue?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swipe.