Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All comparison sliders are dragged when one is selected #6

Open
mckeever02 opened this issue Apr 6, 2016 · 3 comments
Open

All comparison sliders are dragged when one is selected #6

mckeever02 opened this issue Apr 6, 2016 · 3 comments

Comments

@mckeever02
Copy link

I'm using a class to call the plugin and then utilising this on multiple mage comparisons. Is there a way to set this up so that only the one image comparison is altered without having to initiate multiple calls?

@apank
Copy link

apank commented May 20, 2016

The each function will do that for you

$('.ba-slider').each(function(){
     $(this).beforeAfter();
});

@donhatch
Copy link

donhatch commented Dec 10, 2016

@apank - I deleted my previous comment because it was a result of my misunderstanding your solution; sorry about that.

To be clear: the problem is that there is a bug in sample.html (and probably any program
that starts with that as an example); it says:

$('.ba-slider').beforeAfter();

but it should use each() instead, like you said.

@tatarjr
Copy link
Contributor

tatarjr commented Feb 15, 2017

@donhatch are you referring to issue #10 here?

bserem added a commit to bserem/before-after.js that referenced this issue Dec 7, 2017
Multiple sliders on the same page. Credits to @apank (jotform#6)
Use before-after with Drupal behaviors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants