1

我在同一页面上有两个可滚动的 jQuery 实例。不幸的是,我认为发生了一些覆盖和冲突。如何修改以使它们同时正常工作?

//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;
          }
        }
      });

第二套:

//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;
      }
    }
  });
4

1 回答 1

0

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

他们有两个在同一页面上运行。也许它的变量范围有问题?

于 2011-09-02T17:33:12.647 回答