Giter VIP home page Giter VIP logo

jquery.event.move's People

Contributors

al5dy avatar cbrandolino avatar gido avatar marvinklein avatar staktrace avatar stephband avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jquery.event.move's Issues

Mootools more conflict

Hi. There is an issue when using your move event plugin in a page with Mootools more loaded. The following steps can reproduce the issue:

  1. Create an empty page with an element. Give position absolute to the element.
  2. Add mootools and mootools more to your page.
  3. Add jQuery and your move event plugin to the page.
  4. Just bind the 'move' event to the element using jQuery. The element will become draggable!

Note that since you use the move plugin to the swipe plugin this issue also occurs in the swipe plugin.

IE10 Touch devices

jquery.event.move does not currently support Microsoft's Pointer Events, making a less than fluid experience on IE10 touch devices.

Pointer Events are arguably a better spec, and will eliminate the need for
some of the finger tracking code in jquery.event.move. But neither touch
nor pointer events are a proper standard yet.

I don't have a Windows tablet or phone to test on, so I can't do anything about it. Microsoft are helping WebKit implement pointer events: at that point we'll all be able to see them working and debug.

In the meantime, feel free to help out if you can by forking and patching jquery.event.move and sending a pull request.

Cannot read property 'toLowerCase' of undefined

Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
at isIgnoreTag (jquery.event.move.js:198)
at mousedown (jquery.event.move.js:249)
at HTMLDocument.handler (jquery.event.move.js:100)

This happens when you click on scrollbar. Becouse e.target is document and e.target.tagName is undefined.

Inner scroll won't work on iOS unless I remove preventDefault

I used your lib to add swipe-to-close interaction to hamburger menu. The menu has inner scroll. Just so you know, I needed to comment out one line in your code to enable inner scroll on iPhone devices.

screen shot 2018-09-22 at 00 27 55

It might be better not to prevent scrolling by default, but allow us to manually choose wether specific direction should prevent the default event.

License?

Hey Stephen,

Under what license do you distribute your code?

How to get moveend or not

Hi,

This is not actually an issue, it's question, but I must ask here becouse I don't know where to ask.

I'm trying to make slider for web app which has more pages/divs which are floated but they're offset with margin so I can see only one tab per view, and this plugin works fine for me except I wan't something to change.

If I move/drag more than half of width, then "moveend" is called, but if don't nothing happend. So I'm just asking, how to detect if it needs to moveend or not.

I found that this function triggers action:

function activeTouchend(e) {
    var event = e.data.event,
        timer = e.data.timer,
        touch = identifiedTouch(e.changedTouches, event.identifier);
    if (!touch) { return; }
    removeActiveTouch(event);
    endEvent(event, timer);
}

Best regards, and sorry couse I'm asking in issue field.

Need 'movestart' on pointerdown

I know it is a feature to not have the 'movestart' event fire until there is a move but I need that event raised before there is any move for my own purposes. Looked at the code and there is a threshold value set to 6 which I thought if I set it to 0 would do the job but no. I even removed the code in the checkThreshold() that short circuits the function but no luck.

What do I need to do to get the movestart event immediately on pointer down? or maybe fix it so threshold = 0 behaves as expected.

Versions 2.0.0+ broke vertical scroll in Edge Mobile

For some reason after updating from 1.3.6 to 2.0.1, vertical scroll has stopped working in the Microsoft Edge 14 browser in Windows 10 Mobile devices.

Also, vertical scroll still works in the older Internet Explorer 11 mobile browser from an older Lumia, so this issue seems to affect Edge browsers only.

Whenever the plugin is updated, kindly consider not using ECMA Script 2015 methods (like the Symbol function) to prevent developers from ditching this plugin or reverting to version 1.3.6 (like in my case). Users don't always have the device or the browser we would like them to have, so my recommendation is to avoid rendering the plugin unusable for older browsers because there's hardly anything in ES 2015 that is mandatory for the implementation of gestures.

image

Event Increased

Hi

 I am using this functionality for HTML5 game, Every time i load the page which i integrated  jquery.event.move plugin , 'Move end'  event get increased , For Example 

For the first time event occurred one time , But second time i loads event occurred twice, 3rd time it is thrice etc.................. Please give me a solution.

currentTarget for delegated events

Is there a way to get currentTarget to work correctly with delegated events or am I doing something wrong?

$(".itemPalette").on "movestart", ".item", (e) ->
  $(e.currentTarget) # is document rather than .item

release 2.0.0

there is no 2.0.0 release so bower can not update from 1.3.6 to 2.0.0. is this intended? why?

minification fails because of es6 features

on line 101 char 12 you use for ... of ... which is es6 or with moz extension. I am prepending your js to mine then doing minification. since i am using jshint, jslint or eslint before minification it fails. I can tell my preprocessor to use es6 on your file only but it would be nice if you include it too. just add to the head of your script...

/*jshint esversion: 6 */

touch device: page scrolling (in v 1.2)

Hey Stephen,

If I view the demo page (v 1.2) on a touch device (I tried with an iPad, a galaxy nexus and a nexus 7) I can move the red thing around, but cannot scroll the page around anymore.

I tried an older version (1.0.2) and the page scrolled normally.

cheers
JL

velocityX/Y is NaN

I was trying to use your other plugin "jquery.event.swipe.js" and find velocityX/Y return "NaN".
Digging more, I come inside "jquery.event.move.js" and find when "updateEvent" is call, "timeStamp" is undefined and has side effect to false all calculation after about velocity.
Digging again, I was trying to solve this adding "timeStamp" on "event" (inside "movestart" function) but browser throw a "TypeError: setting getter-only property "timeStamp" (which is not a surprise).

In desperation, I corrected by setting a new parameter to "updateEvent" :
function updateEvent(event, touch, timeStamp, eTimeStamp) {
and for the call :
updateEvent(event, data.touch, data.timeStamp, e.timeStamp);

I'm sure this is not the best solution but at least it does the job ^^

Conditionally suppressing scrolling for move events

This is a great little library, however it seems that I will not be able to implement it for my particular use case. Essentially I am looking to create an interaction on the page main container element of a mobile website where dragging your finger from left to right reveals a hidden side menu (a la the Facebook iOS app). I want to utilize the "move" event for this on the page container div, however binding the event subsequently disables native scrolling of the page (as your library intends).

So what I am looking for is a way to conditionally surpress the default event so it only is prevented when the move direction is horizontal (the website is designed to never scroll horizontally anyway), otherwise I want the scrolling to happen as it normally would.

Vulnerability checks failing on js/jquery-3.1.1.js

Within the project is an old version of jQuery in js/jquery-3.1.1.js

Vulnerability checkers like retirejs indicate an issue with jquery.event.move, as it contains an outdated jQuery version with known vulnerabilities. As the readme of jquery.event.move notes jQuery is not required anymore, so removing (or updating) the jQuery would be appreciated.

Thank you!

Can't scroll over input

When the element to scroll contains an input element the user cannot scroll the container if they touch over the input element. For example:

<div class="container" style="width: 500px; overflow: hidden;">
<p>Hello World</p>
<div style="width: 1100px">
<input type="text" id="firstName" style="width: 200px; display: inline-block;" />
<input type="text" id="firstName" style="width: 200px; display: inline-block;" />
<input type="text" id="firstName" style="width: 200px; display: inline-block;" />
<input type="text" id="firstName" style="width: 200px; display: inline-block;" />
<input type="text" id="firstName" style="width: 200px; display: inline-block;" />
</div>
</div>

In this case the user can scroll when they press over the paragraph but not when they press over the input.

Can´t use moveend on body and expect document scrolling to work on mobile devices.

On

https://jsfiddle.net/twjou50r/1/embedded/result/

I have a webpage where scrolling does not work very well on mobile devices.
I am using the emulation in chrome to try this. A phone will also prove the issue.

Problem: Nothing happends when I try to scroll, even if document content is taller than the window.

If I remove the lines

$('body').on('moveend', function ()
{
    /* something */
});

scrolling works as demonstrated on:
https://jsfiddle.net/twjou50r/2/embedded/result/

(if you want to see the source of those jsfiddles, you click "Edit in JSFiddle")

Incoherent values for deltaY

Hi,

after playing a little with your plugin, I found what seems a bug.
Here is an output of some Chrome logging :

This is just a copy of some consecutive move event properties.

Object {delta: 0, y: 680, start: 686, dist: -6} 
Object {delta: -1, y: 679, start: 686, dist: -7} 
Object {delta: -1, y: 664, start: 686, dist: -22} 
Object {delta: -7, y: 656, start: 686, dist: -30} 
Object {delta: -7, y: 648, start: 686, dist: -38} 
Object {delta: -6, y: 641, start: 686, dist: -45} 
Object {delta: -1, y: 635, start: 686, dist: -51}

deltaY is not coherent with other values. When I used it, animation was always slower than cursor movement.
I switch my moving animation to distY and everything is ok.

Thanks for your job !

Scrolling blocked on Chrome

I'm trying to use jquery.event.move.js v1.3.1 with Zurb Foundation's Clearing gallery, but when the plugin is in place, the scroll bar is inoperable in Chrome...

Broken example.

First thing, great job on the framework, no real complaints so far.
Although, it seems to me that the example you have on the framework's webpage is broken:

jQuery('.mydiv')
.bind('move', function(e) {
  // move .mydiv horizontally
  jQuery(this).css({ left: e.startX + e.deltaX });
})
.bind('moveend', function() {
  // move is complete!
});

the culprit is this line:

left: e.startX + e.deltaX

deltaX never really grows, it only oscillates. A better line would be something like:

left: e.distX

Keep up the good job!

Firefox Mobile

Hello :)

I've got a little bug, but I'm not sure if it comes from jquery.event.move...

In my application, you have like a "picture frame" inside of which you can scroll (desktop) or touch and slide (mobile) up/down to trigger a change in the picture displayed (they are cat-petScan/MRI sections), in increments.

I've implemented jquery.event.move to trigger this change and it works perfectly on Chrome Mobile and Safari Mobile. But with Firefox Mobile it seems that the default-native-scrolling is not disabled, the whole page scrolls !

The code looks like that :

    $(this).bind('move', function(e) {
        if (e.deltaY < 0) {
            prevFrame();
        } else if (e.deltaY > 0) {
            nextFrame();
        }
    });

I read (here : http://stephband.info/jquery.event.swipe/) that "Move events, by default, override native scrolling, as they assume that you want to move something rather than scroll the window". And indeed on Chrome/Safari it seems like it.

One thing I've noted is that it's not really consistent, you can obtain the desired effect by going sideways ("creating" a positive e.deltaX) first, it seems to "unlock" something and then the whole page stops to scroll and the sections pass.
Reciprocally, if you are careful and only go vertically (keeping e.deltaX null), you never trigger the sections but instead scroll the whole page...

In pratice, the first few millimeters are almost always vertical and then the finger naturally goes a little sideways, so the page scrolls a little bit and then the desired sections scrolling takes place.

Have you had any problems like that, and/or with Firefox Mobile ?
Thank you !
Jeb

Constrain to parent

Your plugin is exactly what i was looking for,
It miss only a thing it's to constrain the drag to the parent div.

And then it would be perfect for me.

Plugin breaks in jQuery 1.8

In jQuery 1.8 node.data('events') doesn't return events bound to the element anymore, it does $._data(node, 'events') instead. Because of this change plugin throws exception during execution. This also affects jQuery.event.swipe

Add package.json

Not really a big issue, but it would be convenient if package.json were added to this plugin just like you have for jquery.event.swipe.

jQuery 3.0.0 breaks jQuery.event.props usage

https://jquery.com/upgrade-guide/3.0/#breaking-change-jquery-event-props-and-jquery-event-fixhooks-removed

jQuery's event handling performance increased thanks to a reorganization of event property management. The main improvement is that jQuery now only calculates or copies a property on the first access, rather than calculating and copying them up front. This is a really big win with properties that may force layout that the event handler may not even need. The most common use we know of was to add properties for pointer events, which is no longer necessary because those events are supported already in jQuery 3.0. The jQuery Migrate plugin provides support for these properties if you still need them. The related but undocumented mouseHooks and keyHooks lists were removed as well. The team is interested in understanding other use cases before defining new APIs, so feel free to open a ticket.

Use with webpack

Do you have any suggestions for how I might use this properly with webpack? I can get it to function by providing jquery globally in the page, and then importing this (to get it in my bundle) by the explicit passing of a jquery object fails as webpack doesn't seem to allow it to export a function.

Example of non-working setup, but the way I think it should work:

var $ = "jquery";
require("jquery.event.move")($);

This always leads to a runtime error to the effect that the require is not exporting a function.

The only way I can make it work properly is to have window.jQuery defined, and to do require("jquery.event.move").

Handle multitouch properly

When we have more than 1 touch events, it should throw only 1 move event with the two or more touches inside.

move delay in mobile

$('elem').bind('move',function(){

}

any idea it delay 1 second when use 'move' in mobile?

To be a real plugin

Hi, my suggestion to be a real plugin it should work this way.

$("#mydiv").eventmove()({
        containment: "parent",
        drag: true,
        rotate: true,
        resize: true,
        keepratio: true,
        ect: true,
});

Chrome treats document-level touch event listeners as passive by default

The plugin isn't working properly for me in Chrome version 58.0.3029.83 on Android on the demo page at http://stephen.band/jquery.event.move/ . Instead of just the red block moving, the page moves as well.

On the desktop, I can see this warning in Chrome cersion 58.0.3029.110 (64-bit) when using Chrome DevTools console to simulate mobile view:

[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080

The behaviour was added to Chrome in version 56, which came out on 25th January.

Problems with video

In Safari and Chrome, the plugin is preventing clicks on video from registering. That is, I can't click on QT player controls. In Firefox 15 (possibly others), clicking a player control initiates a move event that I can't get out of. So the video starts playing, but then the div is dragged around and can't be let go. It seems to be okay in Firefox 3.6.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.