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.
$(".gallery").touchwipe({
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!
Try and get the parent outside of the touchwipe function, then use it inside it: