neoSwipe
Provides Swipe event to pages and Mobile events to objects.
Based on:
https://github.com/mattbryson/TouchSwipe-Jquery-Plugin
Description
The neoSwipe plugin for VisualNEO Web adds swipe functionality to objects, enabling touch gestures like swiping in various directions, which is essential for creating mobile-friendly and interactive applications. The plugin is based on the TouchSwipe jQuery plugin and allows you to detect swipes for navigation, interactive content, and gesture-based controls. Here’s a breakdown of its primary features:
Basic Swipe Event Handling: The neoSwipe command attaches a swipe event to a specified object, triggering a custom subroutine when a swipe is detected.
- Command: neoSwipe
- Syntax: neoSwipe "objId" customFunc
- objId: The ID of the page or object to which the swipe event is attached.
- customFunc: Name of the subroutine to call when a swipe occurs, passing the swipe direction.
The direction values sent to the subroutine are "left", "right", "up", "down", "in", and "out", allowing you to respond specifically to each gesture.
Example:
neoSwipe "swipeArea" "onSwipeDetected"
This setup will call the onSwipeDetected subroutine whenever a swipe is made within the swipeArea.
Enhanced Mobile Event Detection with neoMobileEvents: The neoMobileEvents command enables more complex touch interactions, adding gestures like pinch, hold, and multi-finger support to an object. Each gesture type sends specific details such as distance, duration, and pinch zoom level.
- Command: neoMobileEvents
- Syntax: neoMobileEvents "objId" customFunc customFunc2 customFunc3 customFunc4
- customFunc: Handles swipes and provides details like direction, distance, and duration.
- customFunc2: Triggered for hold events.
- customFunc3: Detects pinch-in gestures with zoom details.
- customFunc4: Detects pinch-out gestures with zoom level information.
Example:
neoMobileEvents "imageArea" "onSwipe" "onHold" "onPinchIn" "onPinchOut"
This command sets up imageArea to respond to various gestures, providing custom feedback and controls.
Enabling and Disabling Mobile Events: The plugin includes commands to enable, disable, or completely remove mobile events for a given object, useful for managing app states or user permissions.
- Commands:
- neoMobileEventsEnable: Activates mobile events on the target object.
- neoMobileEventsDisable: Temporarily disables mobile events.
- neoMobileEventsDestroy: Completely removes mobile events.
Example:
neoMobileEventsDisable "imageArea"
This disables gesture detection on imageArea, which can be useful during non-interactive app phases.
Practical Applications
The neoSwipe plugin is ideal for:
- Mobile Navigation: Swipe gestures to move between pages or content sections.
- Image Galleries: Pinch-to-zoom and swipe for navigating and scaling images.
- Interactive Apps: Games or educational tools that rely on gesture-based controls.
The neoSwipe plugin significantly enhances the touch interaction capabilities of VisualNEO Web applications, providing a responsive and intuitive user experience on mobile devices.
neoSwipe
|
Purpose: |
Adds a Swipe event to an object and calls a subroutine when it happens. It passes a value to the subroutine with possible values "left" "right" "up" "down" "in" and "out". |
|
Category: |
neoSwipe |
|
Syntax: |
neoSwipe objId customFunc
objId Page or object to attach swipe event customFunc Subroutine to call when user swipes the page |
neoMobileEvents
|
Purpose: |
Adds mobile events to an object and calls a subroutine when it happens. Each event sends different information to the subroutine (see description) |
|
Category: |
neoSwipe |
|
Syntax: |
neoMobileEvents "objId" customFunc customFunc2 customFunc3 customFunc4
objId Object to attach events customFunc Swipe (sends direction, distance, duration, fingerCount) customFunc2 Hold customFunc3 Pinch In (sends direction, distance, duration, fingerCount, pinchZoom) customFunc4 Pinch Out (sends direction, distance, duration, fingerCount, pinchZoom) |
neoMobileEventsDisable
|
Purpose: |
Disable mobile events |
|
Category: |
neoSwipe |
|
Syntax: |
neoMobileEventsDisable "objId"
objId Object to disable events |
neoMobileEventsEnable
|
Purpose: |
Enable mobile events |
|
Category: |
neoSwipe |
|
Syntax: |
neoMobileEventsEnable "objId"
objId Object to enable events |
neoMobileEventsDestroy
|
Purpose: |
Destroy mobile events |
|
Category: |
neoSwipe |
|
Syntax: |
neoMobileEventsDestroy
|
Created with the Personal Edition of HelpNDoc: Free PDF documentation generator