darsain / sly

JavaScript library for one-directional scrolling with item based navigation support.
http://darsa.in/sly
2.87k stars 497 forks source link

Feature request: deactivate slider #183

Open sudodoki opened 9 years ago

sudodoki commented 9 years ago

Hi! Loving your project. Would be really handy to be able to 'deactivate' sly instances so I could emulate multiple instances on the page being mutually exlcusive.

If you wouldn't like that idea, would appreciate help with my workaround for this:

Sly.prototype.deactivate = function() {
  var $els;
  $els = $(this.items.map(_.property('el')));
  return $els.removeClass(this.options.activeClass);
};

Issue would arise when I go back to this 'deactivated' slider & click same item again - activate would assume last active index to be equal to current and do nothing. Cannot nullify the last active index - its kept in closure & not exposed. Suggestion/ideas?

darsain commented 9 years ago

Something like this is not supported right now. Trying to implement it would be a very hacky solution with a lot of edge cases I imagine. It will be doable in 2.0, but can't give you an ETA for that.