19

I'm building out my jquery mobile app out and have been testing in Chrome. Its the best for me because the debugging is great.

I was using a TAPHOLD event but decided to go away from that for a swipe-right event.

Chrome actually registered the taphold, so I was hopeful that it would register a swipe right with the mouse. But I cannot get it to register unless I have to do something else... anyone?

4 Answers 4

19

By now the actual chrome developer tools (tried chrome 20) can emulate touch and swipe events. You can activate that behavior through the tool options, accessible via the little gear-wheel in the bottom corner.

Just check "Emulate touch events" from the options. Then you can also swipe with your mouse.

2
  • 1
    You've got to have the developer tools open for the touch events to work, in my experience.
    – Jasper
    Aug 13, 2012 at 20:29
  • @Jasper Thanks for the quick tip, it wasn't working before as the developer tools was closed. Apr 10, 2013 at 15:29
12

A lot of the answers here are old and out of date. As of Chrome 63, swipe is built-in as long as you are in responsive mode with developer tools open. So open Developer Tools (3 dots->tools->developer tools), then click the phone/tablet icon on the left to put Chrome into a mobile mode. Then if you left click and hold, you will see the cursor changed to a dot, and you can swipe.

2
  • 2
    I'm not in a position to validate this right now but I would totally assume you are correct (based on your rep). This question was asked years ago, so Im switching the answer to this one.
    – Todd Vance
    Jan 5, 2018 at 18:48
  • 1
    Incredible! works on Firefox too. Also enables inspecting the UI on a mobile screen
    – lineage
    Mar 16 at 22:42
11

In desktop browsers I tend to use the right mouse button testing swipes. It will open a context-menu but it actually works (I normally use Chrome 17 and Firefox 10).

For instance when left-clicking and then swiping on an image in Chrome or Firefox it selects the image and you are then moving around the transparent thumbnail of the image. But when right-clicking and swiping the swipe event is fired.

UPDATE

This update is pretty late to the punch but this just shouldn't be necessary anymore. In fact the Chrome developer tools (the ones I'm used to using) have gotten a lot better about emulating devices.

1
  • HOLY moly! It worked!! I would never have guessed! Thanks a ton!
    – Todd Vance
    Feb 21, 2012 at 0:11
9

Update: this appears to be enabled in Chrome by default (37.0.2062.120 as of September 2014) you do the following:

  1. Open Developer Tools
  2. Click the little phone icon next to the search icon in the upper left (next to the Elements tab)
  3. In the Emulation tab on the bottom choose a device model from the drop down

Previous answer:

To get this working in the current version of Chrome (32.0.1700.107 as of Feb 2014) you do the following:

  1. Open Developer Tools
  2. Click the gear icon in the upper right
  3. Select the Overrides tab on the left
  4. Click on Show 'Emulation' view in console drawer
  5. Close the Settings popup
  6. Open the Console (button to the left of the gear)
  7. Click the Emulation tab in the console (next to Console and Search)
  8. Choose a device and click on Emulate (and click Reset to cancel emulation)
1
  • I can't get swipe working on latest Chrome on Mac OS X: Chrome Version 39.0.2171.65 (64-bit). Testing it with www.swipejs.com
    – Giant Elk
    Nov 21, 2014 at 3:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.