jquery.kinetic
jquery.kinetic copied to clipboard
Sudden stop after mouseup
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)); } } });
@freyhubert I can not find the code you mention above. Could you show more info about it? Ex: filename, line...etc
@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
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.
@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.
@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");
}
});
@tsaikd Thank you, this solved the problem
filterTarget: function(target, e){ return !$(target).is('a, i, area, button, input'); }