Finding $(this) attribute in wipeTouch

Feb 12, 2013 at 10:36 AM
Hi, good plugin you have made.

There is just one problem
I want to find out element id that is triggering the event

My code is like this:
  $('#stngs_settingsPage, #stngs_infoPage, #stngs_replayPage, #stngs_paytablePage').wipetouch({
        wipeLeft: function(res) { 
            //back to main menu
            showPage('#stngs_mPage', 'main');
        },
        wipeRight: function(res) { 
            //back to main menu
            showPage('#stngs_mPage', 'main');
        },
        wipeUp: function(res) { 
             var id = $(this).attr('id');
             //var id = '#stngs_settingsPage';
             $(id).animate({ height: '100%', scrollTop: $(id).height() }, 500);
        },
        wipeDown: function(res) { 
            var id = '#stngs_settingsPage';
            $(id).animate({ height: '100%', scrollTop: 0 }, 500);
        }
        
     });
Want to be able to scroll in Settings page div
but can't seems to find element id that triggers the event.
Feb 12, 2013 at 10:58 AM
         console.log(' --- Id: ' + res.source.attr('id'));
Found it :)