jQuery mobile: change font size on pinch-in/pinch-out? -


i'm writing web document reader jqm. don't want users continuously scroll right-left when reading, viewport is:

<meta name='viewport' content='width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=1;' /> 

though, i'm aware users preferences font size may change, due different visual skills... so, thought nice shrink font size on multi-touch shrink action ("pinch-in"), , enlarge font size on multi-touch zoom action ("pinch-out")...

is possible? need external library, beside jqm?

it possible on jquery mobile, need use 3rd party implementation called hammer.js.

it supports large number of gestures like:

  • hold
  • tap
  • doubletap
  • drag, dragstart, dragend, dragup, dragdown, dragleft, dragright
  • swipe, swipeup, swipedown, swipeleft, swiperight
  • transform, transformstart, transformend
  • rotate
  • pinch, pinchin, pinchout
  • touch (gesture detection starts)
  • release (gesture detection ends)

example:

$('#test_el').hammer().on("pinchin", ".nested_el", function(event) {     console.log(this, event); });  $('#test_el').hammer().on("pinchout", ".nested_el", function(event) {     console.log(this, event); }); 

it works jquery mobile, , important. should think of other idea, or @ least idea android 2.x devices because platform doesn't support multitouch events.

there other 3rd party implementations touchy. unfortunately, touchy supports pinch.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -