Advertisement
Guest User

Untitled

a guest
Sep 30th, 2014
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. <div id="flexslider-object" class="flexslider">
  2. <ul class="slides">
  3. <li><img></li>
  4. <li><img></li>
  5. <li><img></li>
  6. </ul>
  7. <ol class="flex-control-thumbs">
  8. <li><a><img></a></li>
  9. <li><a><img></a></li>
  10. <li><a><img></a></li>
  11. </ol>
  12. </div>
  13.  
  14. $.fn.thumbScroller = function () {
  15. var div = $(this),
  16. wrapScreenHeight = div.height(),
  17. top = div.offset().top,
  18. $list = div.find('ol'),
  19. wrapHeight = div.outerHeight(),
  20. listHeight = div.find('ol').outerHeight() * 1.3;
  21. $list.on('mousemove', function (e) {
  22. var cPointY = e.pageY - top,
  23. dP = ((cPointY / wrapHeight));
  24.  
  25. div.animate({scrollTop: (listHeight * dP) - wrapScreenHeight}, 1, "linear");
  26. });
  27. };
  28. $('#product_slider').thumbScroller();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement