Skip to content
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

Kinetic event for movement from kinetic only #97

Open
iamdriz opened this issue Jun 2, 2016 · 1 comment
Open

Kinetic event for movement from kinetic only #97

iamdriz opened this issue Jun 2, 2016 · 1 comment

Comments

@iamdriz
Copy link

iamdriz commented Jun 2, 2016

Is it possible to have an event that fires only when kinetic has been dragged?

Currently if I have:

$('.balls__bar').kinetic({
    cursor: 'default',
    x: true,
    y: false,
    moved: function(){
        ipc.send('projector', { func: 'scrollBallBar', params: [$('.stage-inner').width(), $('.balls__bar').scrollLeft()] });
    }
});

The moved event will fire if .balls__bar is scrolled by another means. I only want to catch kinetic movement by dragging!

@UziTech
Copy link
Collaborator

UziTech commented Jun 2, 2016

You could check this.mouseDown === true

$('.balls__bar').kinetic({
    cursor: 'default',
    x: true,
    y: false,
    moved: function(){
        if (this.mouseDown) {
            ipc.send('projector', { func: 'scrollBallBar', params: [$('.stage-inner').width(), $('.balls__bar').scrollLeft()] });
        }
    }
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants