hammer.js

pan on chart.js also zoom on line charts

本秂侑毒 提交于 2020-01-05 08:11:59
问题 I want to pan and zoom on a line chart with chartjs-plugin-zoom. The problem is that when I use pan it also zoom on chart till just one label remains, there is no problem when chart model is bar. how can I solve this problem? I want pan just to pan not zoom. this is a fiddle that works for bar chart but not works correctly for line chart: https://jsfiddle.net/pfd2on55/ var ctx = document.getElementById("canvas").getContext('2d'); var myChart = new Chart(ctx, { type: 'line', data: { labels: [

Hammer events delegation and reuse of backbone view

谁都会走 提交于 2020-01-04 03:57:04
问题 Edit According the Hammer Github page this bug was due to Manager leaks and should be fixed in the 2.0.5 version - this version is not built online but one can built it by himself. More info can be found here ===================================================== Original question: ===================================================== We are using Backbone with Hammer 2,backbone hammer plugin and hammer jquery plugin. The issue when working with domEvents and only 1 copy of A view it works

Vertical scroll is not working with HammerJS and Angular2

删除回忆录丶 提交于 2019-12-31 12:56:31
问题 I'm having a problem using the HammerJS with Angular2. I have a carousel (based on the bootstrap carousel with Angular2 event handlers) where I'm listening to the swipe left and swipe right events. The swipe itself works perfectly. The problem is that since I use the HammerJS I can not scroll up/down over my carousel component and since it's a full viewport sized item it's a huge issue. How can this issue be solved? Platform: Angular2 2.1.2 Samsung Galaxy S2 with Android 5.1.1 Google Chrome

hammer.js - need default zoom behaviour + swipe

随声附和 提交于 2019-12-25 18:21:09
问题 I want to make it so swiping over an image will take a user to the previous or next image, depending on the direction of the swipe. That part works great, BUT it removes the ability to zoom in on the image. According to this answer the solution is to enable touchAction: 'auto' , but that breaks hammer.js entirely, preventing it from working for swipe at all. Code: <script src="../js/hammer.min.js"></script> <script> $('.imagecontainer').each(function(){ var options = { touchAction: 'auto', };

vertical scrolling blocked by Hammer.js

天涯浪子 提交于 2019-12-25 09:09:14
问题 i am trying to make an app with Intel XDK (build 2727) and right now my problem is that i can't scroll vertical when i have a list which exceeds the screen size. i tracked the problem down to Hammer.js. This plug-in seems to be used for the sidebar. So i tried to comment the source out and voila, it is working. But I need the sidebar and therefore Hammer.js. After research it turned out that others are having the same issue and the most common solution for this seems to be overflow-y: scroll;

How to swipe an element using hammer.js in Backbone View

梦想与她 提交于 2019-12-24 17:19:51
问题 I'm pretty new to both backbone and hammer, but it took me a long time and I still didn't achieve my goal, so if someone could help, I'd be really thankful! I want to have this functionality: http://jsfiddle.net/uZjCB/7/ but using it in a backbone view. This is my code so far: HTML <html> <head> <title>Using backbone</title> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> </head> <style> body { overflow:hidden; height: 100%; } .colorContainer { position:

IOS 13 not raising panend events when changing panning direction

本秂侑毒 提交于 2019-12-24 01:12:37
问题 I have a custom image slider using Hammer.js events. I use the following to create my 'hammer' object: const hammerPan = new Hammer(domElement, { // lock vertical scrolling when panning left to right touchAction: 'pan-y', recognizers: [ // we don't care about vertical, but we want always to get panstart and panend // events so we use ALL to prevent unncesessary filtering from hammerjs [Hammer.Pan, { direction: Hammer.DIRECTION_ALL, threshold: 10 }] ] }); The slider (like most sliders) moves

Long press (hold) with jquery hammer.js 2 and event delegation

那年仲夏 提交于 2019-12-23 19:25:24
问题 I recently upgraded to hammer.js 2 and one of the first things a I noticed was that "hold" has been replaced with "press". My old code worked fine with event delegation, but switching to press only seems to work when I put it on a specific element. Note: I use hammer.js through the jquery plugin Hammer.js 1 $(element).hammer().on("hold",callback); Works fine $(rootElement).hammer().on("hold",".elementSelector",callback); Works fine Hammer.js 2 This $(element).hammer().on("press",callback);

Framework7: How to get pinch to zoom on page-content with hammer.js?

旧街凉风 提交于 2019-12-23 05:43:30
问题 I would like to use pinch to zoom on page-content. I tried this in myapp.js but it still does not work. Did i forget something? jquery, hammer js and jquery hammer js (wrapper) are initialized var mc = $(".page-content").hammer(); mc.add(new Hammer.Pinch({ threshold: 0 })); 回答1: There are two problems in your question: How to handle pinch with hammer How to properly zoom using Javascript + CSS I posted an answer to a similar question about zooming in Javascript + CSS (which is your problem #2

Triggering Hammer.js drag/slide behavior on mouse click

若如初见. 提交于 2019-12-23 01:19:21
问题 I'm using Hammer.js to allow for dragging between panes. I also want to allow an alternate action where there's also a "Next" button you can click on (with a mouse) or touch (on touchscreen), that will automatically animate a slide to the next screen. Imagine the Hammer.js Carousel demo with a "next" button in the middle of the page. When you click, it acts as if you did a slideleft to take you to the next pane. I figured I should be able to trigger with something like: var hammertime =