Skip to content

Commit

Permalink
Improve usage documentation.
Browse files Browse the repository at this point in the history
Multiple sliders on the same page. Credits to @apank (jotform#6)
Use before-after with Drupal behaviors.
  • Loading branch information
bserem authored Dec 7, 2017
1 parent 46abb2f commit 817cdfe
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,26 @@ The [Medium article](https://medium.com/jotform-form-builder/making-a-responsive

Or you can simply copy the contents of the sample.html to your own page. All links are called from a CDN.

##### Multiple sliders on the same page
```
$('.ba-slider').each(function(){
$(this).beforeAfter();
});
```

##### Use with Drupal Behaviors
```
(function ($, Drupal) {
Drupal.behaviors.pronatura_image_comparison = {
attach: function (context, settings) {
$('.ba-slider').each(function(){
$(this).beforeAfter();
});
}
};
})(jQuery, Drupal);
```


#### LICENSE

Expand Down

0 comments on commit 817cdfe

Please sign in to comment.