Take the 2-minute tour ×

I am currently using a plugin called touchwipe.js so that I can swipe left and right to replace the prev and next buttons I have on my custom slider. The only issue I am having is that I can't seem to get the parent id of the gallery I am sliding.

   wipeLeft: function() {
      var section=$(this).parent().parent().parent().attr('id');

When I use just a normal jquery click it works fine. Can you please advise me? Thanks!

share|improve this question
Can you post your HTML –  areich Jan 31 '13 at 15:03
add comment

1 Answer

up vote 0 down vote accepted

Try and get the parent outside of the touchwipe function, then use it inside it:

var gallery = $(".gallery");
var parent  = gallery.parent()..... 

   wipeLeft: function() {

share|improve this answer
add comment

Your Answer


