Comments (8)
Is there a way to have a listener listen for when the user lets go of the handle and the animation ends on one of the steps?
The animationCallback
gives you the exact value of handle as long as the handle is moving. You can detect the current step either by calling getStep()
or by calculating it yourself using the value and the number of steps you have.
Is there a listener for when the user is dragging the handle and pauses whiles still holding down the handle?
No direct solution at the moment, can't think of an idea.
from dragdealer.
Yes I am aware of the animationCallback, however I am looking for when the handle animation is complete.
lindsey siehda
lsdoodle.com
WhimInspiration.com
On Nov 24, 2014, at 4:49 PM, Ovidiu Cherecheș [email protected] wrote:
Is there a way to have a listener listen for when the user lets go of the handle and the animation ends on one of the steps?
The animationCallback gives you the exact value of handle as long as the handle is moving. You can detect the current step either by calling getStep() or by calculating it yourself using the value and the number of steps you have.
Is there a listener for when the user is dragging the handle and pauses whiles still holding down the handle?
No direct solution at the moment, can't think of an idea.
—
Reply to this email directly or view it on GitHub.
from dragdealer.
Yes I am aware of the animationCallback, however I am looking for when the handle animation is complete.
Maybe I'm missing something, but wouldn't this do it?
var waitingForAnimation = true,
prevX = null;
// ...
animationCallback: function(x) {
if (!waitingForAnimation) {
return;
}
if (x == prevX) {
console.log('animation finished');
waitingForAnimation = false;
prevX = null;
} else {
prevX = x;
}
}
Sorry for the hackish solution, no out-of-the-box one comes to mind.
from dragdealer.
Better than mine, using a timer. Thanks!
Sent from my iPhone
On Dec 6, 2014, at 12:34 PM, Ovidiu Cherecheș [email protected] wrote:
Yes I am aware of the animationCallback, however I am looking for when the handle animation is complete.
Maybe I'm missing something, but wouldn't this do it?
var waitingForAnimation = true,
prevX = null;// ...
animationCallback: function(x) {
if (!waitingForAnimation) {
return;
}
if (x == prevX) {
console.log('animation finished');
waitingForAnimation = false;
prevX = null;
} else {
prevX = x;
}
}
Sorry for the hackish solution, no out-of-the-box one comes to mind.—
Reply to this email directly or view it on GitHub.
from dragdealer.
I am working with your solution and the only problem is, is that prevX never ends up equaling x, so it will never call when animation is finished?
lindsey siehda
lsdoodle.com
WhimInspiration.com
On Dec 6, 2014, at 12:34 PM, Ovidiu Cherecheș [email protected] wrote:
if (!waitingForAnimation) {
return;
}
if (x == prevX) {
console.log('animation finished');
waitingForAnimation = false;
prevX = null;
} else {
prevX = x;
}
from dragdealer.
Are you using the latest version of Dragdealer, I know this was an issue at some point but was fixed in #21
from dragdealer.
Yes I am 0.9.7 , If you test your code you provided you will see it never gets called.
Also, is there a tween on the slider animation? Any way to set that tween?
lindsey siehda
lsdoodle.com
WhimInspiration.com
On Dec 10, 2014, at 3:17 PM, Ovidiu Cherecheș [email protected] wrote:
Are you using the latest version of Dragdealer, I know this was an issue at some point but was fixed in #21
—
Reply to this email directly or view it on GitHub.
from dragdealer.
You're right, the animationCallback will never be called with the same value twice. I'm sorry, I don't think you can achieve the desired effect out of the box. If you have the time and will you might be able to fork Dragdealer and add some extra callbacks to server your needs. Some cues:
Also, is there a tween on the slider animation? Any way to set that tween?
No. This has been a long wish of mine from the beginning, but it would mean refactoring most of the original code so it never happened. What Dragdealer does is eat up part (based on speed option) of the remaining delta distance with every animation frame, until it reaches the target position
from dragdealer.
Related Issues (20)
- dragStopCallback is called when clicking handle element
- set a minimum range?
- Infinite number of tiles HOT 7
- Set step to start on when initialising HOT 1
- autoplay HOT 1
- Mousewheel Functionality
- Dragdealer does not take into account scale() css3 transform when calculating handle positions
- How to disable point to scroll outside the handle? HOT 4
- Change color of the 'handle red-bar' depending on the value? HOT 1
- Handle bar still moving even when dealer is disabled. HOT 1
- preventDefault when clicking an element inside Dragdealer HOT 1
- Can you change drag speed? HOT 2
- dragdealer infinity slides HOT 5
- dragdealer number of images HOT 1
- Type script Definitions HOT 1
- Unable to preventDefault inside passive event listener invocation.
- Is Dragdealer have destroy method or analog to stop calling requestAnimationFrame? HOT 3
- how to disable wrapper handle HOT 1
- css: transform scale - DragDealer jumps on entry
- Content scroller but with Horizontal movement? HOT 1
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 dragdealer.