0

I'm using for a mobile solution the slider "swipe.js" (https://github.com/bradbirdsall/Swipe). Now i would like to use the api-function getPos to return the actually slide. Unfortunatley my code doesn't work:

 var elem = document.getElementById('mySwipe');
 window.mySwipe = Swipe(elem, {
 callback: function() {
       var pageNumber = elem.getPos();
       alert("P"+pageNumber);
}
});

What's wrong? how doest it work?

thanks for your help

Stiller Eugen
  • 681
  • 2
  • 10
  • 28

1 Answers1

0

You were almost there:

var pos = mySwipe.getPos() + 1;
alert( pos );
user1002428
  • 88
  • 1
  • 7