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;
      }
    }
  });
2
  • What exactly is your problem? Can you define "properly"? Commented Sep 2, 2011 at 17:30
  • Sure, the disabled class is being applied to the #mediaNavScrollable when interacting (and reaching the end of the scrollable) for .mediaScrollable Commented Sep 2, 2011 at 17:33

1 Answer 1

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?

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, the scrollables themselves work. It's the onSeek and onBeforeSeek part that seems to be getting confused a bit

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.