How to use jQuery Mobile for its touch event support only (no UI enhancements)?

前端 未结 8 677
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-04 07:09

I’m working on a web app that has its own look and feel. I want to use jQuery Mobile for the touch events support only.

When I link jquery.mobile.min.js (without li

8条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-04 07:35

    If you just want to bind to touch/gesture events I'd use jGestures instead:

    http://jgestures.codeplex.com/

    Nice little jquery plugin that I've used on projects before with a big range of events to bind to:

    Available events:

    orientationchange The device is turned clockwise or counterclockwise. This event is triggered by the device and might use an internal gyroscope.

    pinch Is triggered during a pinch gesture (two fingers moving away from or towards each other).

    rotate Is triggered during a rotation gesture (two fingers rotating clockwise or counterclockwise).

    swipemove Is triggered during a swipe move gesture (finger(s) being moved around the device, e.g. dragging)

    swipeone Is triggered after a swipe move gesture with one touchpoint (one finger was moved around the device)

    swipetwo Is triggered after a swipe move gesture with two touchpoints (two fingers were moved around the device)

    swipethree Is triggered after a swipe move gesture with three touchpoints (three fingers were moved around the device)

    swipefour Is triggered after a swipe move gesture with four touchpoints (four fingers were moved around the device)

    swipeup Is triggered after an strict upwards swipe move gesture

    swiperightup Is triggered after a rightwards and upwards swipe move gesture

    swiperight Is triggered after a strict rightwards swipe move gesture

    swiperightdown Is triggered after a rig*htwards and downwards swipe move gesture

    swipedown Is triggered after a strict downwards swipe move gesture

    swipeleftdown Is triggered after a leftwards and downwards swipe move gesture

    swipeleft Is triggered after a strict leftwards swipe move gesture

    swipeleftup Is triggered after a leftwards and upwards swipe move gesture

    tapone Is triggered after a single (one finger) tap gesture

    taptwo Is triggered after a double (two finger) tap gesture

    tapthree Is triggered after a tripple (three finger) tap gesture

    pinchopen Is triggered when a pinchopen gesture (two fingers moving away from each other) occured and the touchpoints (fingers) are removed the device.

    pinchclose Is triggered when a pinchclose gesture (two fingers moving towards each other) occured and the touchpoints (fingers) are removed the device.

    rotatecw Is triggered when a clockwise rotation gesture (two fingers rotating clockwise) occured and the touchpoints (fingers) are removed the device.

    rotateccw Is triggered when a counterclockwise rotation gesture (two fingers rotating counterclockwise) occured and the touchpoints (fingers) are removed the device.

提交回复
热议问题