Skip to content

Commit

Permalink
changed documentation for events
Browse files Browse the repository at this point in the history
  • Loading branch information
Arinas committed Oct 22, 2020
1 parent 5de0e87 commit 16f5f2b
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -471,16 +471,20 @@ <h2>Events</h2>
</tbody>
</table>
<h4>Examples</h4>
<pre>
<code class="language-javascript">$('.gallery a').on('show.simplelightbox', function () {
<pre><code class="language-javascript">let gallery = new SimpleLightbox('.gallery a');
gallery.on('show.simplelightbox', function () {
// do something…
});

$('.gallery a').on('error.simplelightbox', function (e) {
gallery.on('error.simplelightbox', function (e) {
console.log(e); // some usefull information
});</code>
</pre>
});

// with jQuery nearly the same
let gallery = $('.gallery a').simpleLightbox();
gallery.on('show.simplelightbox', function () {
// do something…
});</code></pre>
</div>
</div>
</div>
Expand Down Expand Up @@ -738,7 +742,7 @@ <h2>Author/<br />Contributors</h2>

$('body').fadeIn(200);

var $gallery = new SimpleLightbox('.small-demo a', {});
let $gallery = new SimpleLightbox('.small-demo a', {});

interval = window.setInterval(function(){
$('.scrollwheel').animate({
Expand Down

0 comments on commit 16f5f2b

Please sign in to comment.