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

Scroll to page with id/class #18

Closed nicknmd closed 10 years ago

nicknmd commented 10 years ago

Hi,

Thanks in progress for this awesome js! Is there an easy implementation to scroll to a page with a specific id/class?

Cheers

Nick

Stereobit commented 10 years ago

No, I haven't implemented something like this. But You can just get the index of a certain item to get the page number. Something like this:

function giveMeIndex() {
  var pages = $('.dragend-page');

  return pages.index(pages.filter('.selector-you-search-for')) + 1;
}
nicknmd commented 10 years ago

Thanks for the quick reply! I'll try it out!