Todd Vance
Todd Vance

Reputation: 4711

Can I do a swipe (left or right) in Chrome (PC) with a mouse?

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?

Upvotes: 21

Views: 33594

Answers (4)

Scott C Wilson
Scott C Wilson

Reputation: 20026

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.

Upvotes: 13

Jasper
Jasper

Reputation: 76003

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.

Upvotes: 10

Gloopy
Gloopy

Reputation: 37785

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)

Upvotes: 8

echox
echox

Reputation: 9860

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.

Upvotes: 17

Related Questions