Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

  1. Create a new variable for caching the target '.mynewicon' classE, e.g., var mynewicon = $('.mynewicon);

  2. Add following code to create the touch events for touchStart, touchEnd and touchCancel.


    No Format
    nopaneltrue
    $( mynewicon).live("touchstart", function () {

...

  1.  
     $(this).addClass("home-icon-active-fake");

...

  1.  
     })

...

  1.  
     $( mynewicon).live("touchend", function () {

...

  1.  
     $(this).removeClass("home-icon-active-fake");

...

  1.  
     })

...

  1.  
     $( mynewicon).live("touchcancel", function () {

...

  1.  
     $(this).removeClass("home-icon-active-fake");

...

  1.  
     })



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

...

.