Two-way "sync" #567

Closed
wfendler opened this Issue Feb 25, 2013 · 2 comments

Projects

None yet

2 participants

@wfendler

I'm trying to get sync to work both ways. I want two slideshows, but if you swipe on either of them, the other one follows. Sync gets this to work, but only on one slideshow, if you swipe on the one you didn't set the sync property on, it will work independently of the other slideshow.

Dual Slideshow

What I currently have:

  $('#flexslider--main').flexslider({
    animation: "slide",
    easing: "swing",
    multipleKeyboard: true,

    directionNav: false,
    controlNav: true
  });

  $('#flexslider--caption').flexslider({
    sync: '#flexslider--main',
    animation: "slide",
    easing: "swing",
    directionNav: false,
    multipleKeyboard: true,
    controlNav: false,
    sync: '#flexslider--main'
  });
@wfendler

Came up with a "solution". The only relevant property to this issue is the before: callback.

  $('#flexslider--main').flexslider({
    animation: "slide",
    animationLoop: true,
    easing: "swing",
    multipleKeyboard: true,
    directionNav: false,
    controlNav: true,
    before: function(slider){
      $('#flexslider--caption').flexslider(slider.animatingTo);
    }
  });

  $('#flexslider--caption').flexslider({
    animation: "slide",
    animationLoop: true,
    easing: "swing",
    directionNav: false,
    multipleKeyboard: true,
    controlNav: false,
    before: function(slider){
      $('#flexslider--main').flexslider(slider.animatingTo);
    }
  });

Does anyone see any "danger" in this method?
One issue I've noticed is the when you slide from last slide to first slide, the swiped slideshow slides forward while the one following goes through all previous slides to the appropriate slide, not forward like it should.

@mattyza
Member
mattyza commented Feb 26, 2013

Looks good. You'd just need to ensure that the slideshows both have an equal number of slides. :)

@mattyza mattyza closed this Feb 26, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment