This topic describes how to write touch-events for a new icon in the Aptify Mobile for Members user interface.
Under scripts/aptify.touchevents.js
- Create a new variable for caching the target '.mynewicon' classE, e.g., var mynewicon = $('.mynewicon);
Add following code to create the touch events for touchStart, touchEnd and touchCancel.
No Format nopanel true $( mynewicon).live("touchstart", function () {
...
$(this).addClass("home-icon-active-fake");
...
})
...
$( mynewicon).live("touchend", function () {
...
$(this).removeClass("home-icon-active-fake");
...
})
...
$( mynewicon).live("touchcancel", function () {
...
$(this).removeClass("home-icon-active-fake");
...
})
Note | |
---|---|
|
...
|
...
Whenever a new button is added which has click and touch effect, add a touch event to make it work on a mobile device |
...
. |