Stereobit / dragend

dragend JS – a touch ready, full responsive, content swipe script
http://stereobit.github.com/dragend/
MIT License
486 stars 113 forks source link

scrollToPage example #5

Closed syodash closed 11 years ago

syodash commented 11 years ago

can you make an example with scrollToPage please, i've tried, but i can't make it work.

Best regards

Stereobit commented 11 years ago

When you create a dragend instance with for example

  $("#container").dragend();

you can call the dragend method a second time to trigger some actions. When you want to go to a page when you click on a link you could do something like this:

  $("#container").dragend();
  $("#my-link").on("click", function(){
     $("#container").dragend({
      scrollToPage: 2
    });
  });

instead of scrollToPage you can use jumpToPage to get to a page without a animation. Or

$("#container").dragend("left");

toswipe left or right.

Hope that helps,

Tobi