Git Product home page Git Product logo

jquery.hammer.js's People

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  avatar  avatar  avatar  avatar  avatar

jquery.hammer.js's Issues

Bower support

Need to tag v1.0.0 so bower can find it. Here's the output from Bower currently:

bower jquery-hammerjs#~1.0.0 ENORESTARGET No tag found that was able to satisfy ~1.0.0

latest version

hi :)
i see that latest version of your great jquery hammer plugin is
for Hammer.JS - v1.0.6
but latest hammer version is Hammer.JS - v1.0.10
(im trying to upgrade to latest because of some issues im having with previous one)

Does your version work also with 1.0.10?

can i simply replace hammer code on top of the plugin with the 1.0.10 , would it then work?

thank you so much for your help

stopPropagation not working?

Hi,
I recently updated to most recent hammer.js and jquery.hammer.js . I was previously using jquery.hammer-full.js. There seem to be some major changes in usage that I am just feeling out. One significant change seems to be that there are no more methods in event.gesture like "stopPropagation" and "stopDetect" -- calling these will now return "undefined". Seeing this I thought I could use "stopPropagation" method in the top level event in order to stop a touch event from bubbling up the DOM like I would for any "standard" event. However, this doesn't seem to work:
http://jsfiddle.net/justinshea/4tL6xub1/
In the example you will notice that tapping on the innerbox will bubble to outerbox even though stopPropagation is called for tap event in innerbox..Not sure if this is an "issue" or if I am just missing something??? any/all feedback is appreciated...
Thanks,
Justin

The example does not work

I downloaded this but the event.html example doesn't work because the hammer.js folder doesn't include the js/plugin folder

Using jquery hammer in require...

I am building a Single Page Application using Backbone, but I am I have a feeling I am implementing this incorrectly. I get the following errors:

"NetworkError: 404 Not Found - http://sd.local/js/hammerjs.js"
hammerjs.js (line (null))
Error: Script error for: hammerjs http://requirejs.org/docs/errors.html#scripterror


var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);

require.js (line 163)

My require config like this:

require.config({
    paths: {
        hammer: 'libs/plugins/hammer/hammer.min',
        jqueryhammer:'libs/plugins/hammer/jquery.hammer.min'
        }
});

The call to jquery.hammer

define([
    'hammer',
    'jqueryhammer'
], function (Hammer) {
    'use strict';
        //Calling the redner() function from this view will cause the above error.

Minification breaks source in IE8

Strange error but I can't get jquery.hammer.js to work after being minified. I have tried using the supplied minified version, using uglify and uglify2. Using the non minified version produces no errors.

Tested on.
IE 8.0.6001.18702
Windows XP
Service Pack 3

hammer-full.min.js throws Object expected at line 7 character 779

var d=function w(a,b){return new w.Instance(a,b||{})};

replacing the above minified code with the following removes the exception.

var d=function w(a,b){return new w.Instance(a,b||{})};d=w;

original source line 29 hammer.js

var Hammer = function Hammer(element, options) {                                                                                                                                                                                                                   
    return new Hammer.Instance(element, options || {});
};

se example file at https://dl.dropboxusercontent.com/u/9962821/hammerjs-ie8-bug.html

Horizontal swipe not compatible with vertical swipe ?

Hello,

Working on my website, I may have found what seems to be a bug (or a lack of knowledge :p)... ? In my testpage (http://www.soykje.com/testeur/), I wanted to have vertical swipe for mobile devices to navigate up and down, and horizontal swipe to toggle left and right sidebars.

I'm not a JS excerpt so maybe I missed something... But is there any problem in having for the same document horizontal and vertical swipe ?

Thank you !

Bower dependency

bower.json is listing hammerjs (github.com/EightMedia/hammer.js) as a dependency. Shouldn't it be listing hammer.js (github.com/hammerjs/hammer.js)?

I get a duplicate component when installing jquery.hammer.js while already have hammer.js installed.

README.md: Use on() instead of bind()

Regarding the README.md:
As stated in the official documentation of bind(), on() should be used instead:

As of jQuery 3.0, .bind() has been deprecated. It was superseded by the .on() method for attaching event handlers to a document since jQuery 1.7, so its use was already discouraged. Link

Update npm version w/ standalone files?..

Hey there -

I tried pulling in the npm module npm install jquery-hammerjs --save and noticed that the standalone files were not included. Is this intentional? Are there plans to add them?

thanks,
-matt

Uncaught TypeError: Cannot read property 'timeStamp' of undefined

Sometimes I get the error:
Uncaught TypeError: Cannot read property 'timeStamp' of undefined

In this line: https://github.com/EightMedia/jquery.hammer.js/blob/4ccab20ce569e1fe257d48860858d8bf4421a19c/jquery.hammer-full.js#L1310

It happens when I finish dragging a sidebar (holding a button that has a tap event) and quickly click another button that has a tap event.

Replacing:

since_prev = prev && ev.timeStamp - prev.lastEvent.timeStamp;

with

since_prev = prev && prev.lastEvent && ev.timeStamp - prev.lastEvent.timeStamp;

solves the issue.

Updating from 1.1.3 to 2.0.0 causes hammer() not a function

Was updating my packages.

Updating from 1.1.2 -> 1.1.3 was all good.

Updating from 1.1.3 -> 2.0.0 causes the hammer function to disappear.

$(element).hammer().bind('event', handler) ceases working where $(element).hammer().on('event', handler) had worked previously.

Am I missing something? Did the API change further? Do I need to separately include another package?

Bind to few events

I'd like to be able to bind few events to one function. Something like this:

$e.hammer().bind(['swipeleft','panleft'], function (event)   {
      $(event.target).carousel('next');
});

tap and pressup interferences?

Hi. I''m implementing hammer 2 to manage pressup and tap event on table rows. Everything works fine but I get an issue. This is my code:

$('#grid_in').hammer({time: 1000, domEvents: true}).on('pressup', 'tr', function () {
$(this).addClass('row-selected');
})
$('#grid_in').hammer({domEvents: true}).on('tap', 'tr:not(.row-selected)', function () {
$(this).removeClass('row-selected');
});

So if I press for just a few time, the class is added and then immediately removed: it looks like pressup fires even if I press for less a second. What do I am missing?
Thank you for your help.

Support Browserify

Right now the plugin doesnt support proper include via Browserify (through npm).

Just a basic tutorial on how to use this

No matter where I look, there is hardly anything on how to use this damn framework. Everything is so vague and they hardly explain how to implement this stuff. I simply want to add one swipe function to a HTML object. But I can't find ANY useful resources and it's so annoying. I have gone from the Hammer.js, to Hammer.min.js to the jquery.hammer.js and every single one of them has given me a error. Either saying Hammer is not defined or a addeventlistener is not a function - hammer js.

Just make ONE simple tutorial on how to implement the framework. We aren't all well-experienced coders. Everyone just assumes you can just figure it out with a one line explanation of -

"It’s easy to use, just include the library and create a new instance. -
var hammertime = new Hammer(myElement, myOptions);
hammertime.on('pan', function(ev) {
console.log(ev);
});"

Ok.. so I do that but then it's the same damn errors haha.

bug off event

Hi,
I am a developer of touchscreen apps that are html based and i really need pay attention to on and off events.
i tested this function in the new version of hammer, and as far as i can say it´s not working, index is always false.

In versions v1.0.6dev works really good.
This is what i normally do: node.obj.off(node.event, node.callback);

off: function offEvent(gestures, handler) {
var self = this;

    console.log("gestures :: ", gestures);
    console.log("handler :: ", handler);

    Event.off(self.element, gestures, handler, function(type) {
        var index = Utils.inArray({ gesture: type, handler: handler });


        console.log("index  :: ", index);


        if(index !== false) {
            self.eventHandlers.splice(index, 1);
        }
    });
    return self;

gesture.deltaX is null or not an object in IE

/*! Hammer.JS - v1.1.3 - 2014-05-22
 * http://eightmedia.github.io/hammer.js
 *
 * Copyright (c) 2014 Jorik Tangelder <[email protected]>;
 * Licensed under the MIT license */

jquery.hammer-full.js

In IE7 and IE8,

$("#div").hammer(hammer_options).on("dragstart", function (ev) {
      dragStartX = ev.gesture.deltaX, dragStartY = ev.gesture.deltaY;
 })

Got error:

'gesture.deltaX' is null or not an object

RequireJS Optimiser "has more than one anonymous define"

When using RequireJS Optimiser the Optimiser output the following message regarding jquery-hammerjs.

vendor/jquery-hammerjs/jquery.hammer.min.js has more than one anonymous define. May be a built file from another build system like, Ender. Skipping normalization.

jQuery.UI events don't work

It will disable jQuery.UI.draggable in case of such a code:
sp.draggable().hammer()

On the other hand, events of hammer.js don't fire in case of this:
sp.hammer().draggable()

But, in v1.0.5 - 2013-04-07, all events had fired.

Add support for filtering events

I am trying to implement an event handler on the body element that is targeted to sub-elements with a selector. In the below example, the click handler works because jQuery allows you to filter for child elements on the click handler, but the handler for hammer does not.

$("body").on("click", "[data-evo-overlay-toggle]", toggleOverlay );
$("body").hammer().on("swiperight", "[data-evo-overlay-swiperight]", toggleOverlay);

It would be nice to have support for filtering.

off() with no arguments

From what I have tested its not possible to use off() without any arguments?

$(element).hammer().off(); // not possible
$(element).hammer().off('tap'); // possible

I would like the off to work like explained on jQuery documentation:
Calling .off() with no arguments removes all handlers attached to the elements. Specific event handlers can be removed on elements by providing combinations of event names, namespaces, selectors, or handler function names. When multiple filtering arguments are given, all of the arguments provided must match for the event handler to be removed.

Loading the newest release (v1.0.0 - 2014-01-02)

I was getting jquery-hammerjs using Bower ("jquery-hammerjs": "*"). It downloaded file jquery.hammer.js to hammerjs folder. I then used RequireJS (with jquery injected using shim config) to load the plugin.

After the latest release things changed and now Bower downloads two folders (hammerjs, and jquery-hammerjs). I can't figure out how to load the plugin now with RequireJS. Any hints on what the changes are about and what is the recommended approach to use it with AMD loader?

Hammer 2.0

Will this plugin be updated to Hammer 2.0?

Version 2 doesn't work with Node.js and works badly with Browserify

In Node.js, require('jquery') will instead return a jQuery factory that requires a window, thus jquery.hammer.js breaks, as it expects jQuery to be loaded.
We test our GUI on Node.js with jsdom and we'd like this to work.

It also doesn't make much sense to depend on jQuery. This makes you bring your own version of jQuery, bloating the size of a Browserify bundle. It also attaches your plugin to your copy of jQuery, as opposed to a version of jQuery our code is using.
It is much better to use peer dependencies to hint what jQuery you need,
and then take window or jQuery as a parameter or at least rely on jQuery as a global.

Would you be open to big API changes in your module to fix these problems?
It may force you to bump the major version again, but otherwise this module is currently unusable in Node.js and with Browserify, in my opinion.

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.