1

I've got two instances of a jQuery scrollable on the same page. Unfortunately, I think there's some overwriting and collision going on. How do I modify to get them to both work together and properly?

//Scrollable for Social Sidebar area
    $(".socialScrollable").scrollable({ next:".socialNext", prev:".socialPrev", easing:"easeInOutCubic", vertical:true});
      var scrollable = jQuery(".socialScrollable").data("scrollable");
      var size = 3;
      scrollable.onSeek(function(event, index) {
        if (this.getIndex() >= this.getSize() - size) {
          jQuery("a.socialNext").addClass("disabled");
        }
      });
      scrollable.onBeforeSeek(function(event, index) {
        if (this.getIndex() >= this.getSize() - size) {
          if (index > this.getIndex()) {
            return false;
          }
        }
      });

Second set:

//Scrollables for Media page
$(".mediaScrollable").scrollable({ easing:"easeInOutCubic"}).navigator({navi:'#pressNavTabs'});

$("#mediaNavScrollable").scrollable({ easing:"easeInOutCubic", next:".nextMedia", prev:".prevMedia"});
  var mediaScrollable = jQuery("#mediaNavScrollable").data("scrollable");
  var mediaSize = 4;
  scrollable.onSeek(function(event, index) {
    if (this.getIndex() >= this.getSize() - mediaSize) {
      jQuery("a.nextMedia").addClass("disabled");
    }
  });
  scrollable.onBeforeSeek(function(event, index) {
    if (this.getIndex() >= this.getSize() - mediaSize) {
      if (index > this.getIndex()) {
        return false;
      }
    }
  });
Keefer
  • 2,269
  • 7
  • 33
  • 50

1 Answers1

0

http://flowplayer.org/tools/demos/scrollable/site-navigation.html

They have two running on the same page here. Perhaps its a problem with your variable scoping?

wesbos
  • 25,839
  • 30
  • 106
  • 143
  • Yes, the scrollables themselves work. It's the onSeek and onBeforeSeek part that seems to be getting confused a bit – Keefer Sep 02 '11 at 17:37