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

Sudden stop after mouseup #94

Open
freyhubert opened this issue Mar 14, 2016 · 6 comments
Open

Sudden stop after mouseup #94

freyhubert opened this issue Mar 14, 2016 · 6 comments

Comments

@freyhubert
Copy link

Firstly, thanks for this great plugin. I'm facing an issue while using filterTrigger method. There is no deceleration after mouseup, scroll stops immediatelly. If I comment this method out, everything works fine, except preventing child elements events (of course).
ul.kinetic({ filterTarget: function(target, e){ if (!/down|start/.test(e.type)){ return !(/area|a|input/i.test(target.tagName)); } } });

@tsaikd
Copy link
Collaborator

tsaikd commented Mar 16, 2016

@freyhubert
I can not find the code you mention above.
Could you show more info about it?
Ex: filename, line...etc

@freyhubert
Copy link
Author

@tsaikd
Hi,
this code is mentioned under Filtering Clickable elements here: https://github.com/davetayls/jquery.kinetic
If I comment filterTarget out, everything works fine with smooth deceleration.

Mac OSX 10.10.5 Yosemite, Firefox 44.0.2

@tsaikd
Copy link
Collaborator

tsaikd commented Mar 16, 2016

It's just an example code in README.

filterTarget is a option for customizing the behavior of kinetic.
If you don't need to filter mouse event on element, just ignore filterTarget option.
kinetic support many options. You just pick up options to fit your need.

@freyhubert
Copy link
Author

@tsaikd Of course, but I need to filter mouse event. I'm using Kinetic above product table so I need to have the ability to click on child elements inside wrapper.

@tsaikd
Copy link
Collaborator

tsaikd commented Mar 16, 2016

@freyhubert
I think you should find the correct way to filter the element in filterTarget option.
For example:

<div id="wrapper">
    <div class="kinetic-enable-this-element">foo</div>
    <div class="kinetic-disable-this-element">bar</div>
</div>
$('#wrapper').kinetic({
    filterTarget: function(target, e){
        return $(target).hasClass("kinetic-enable-this-element");
    }
});

@freyhubert
Copy link
Author

@tsaikd Thank you, this solved the problem
filterTarget: function(target, e){ return !$(target).is('a, i, area, button, input'); }

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