Hi!
I have a perfectly working script to toggle classes. ;-))
Now I have a gallery "lightgallery" which should control the toggle.
Instead of clicking on a button to toggle the classes, the classes should be toggled when the gallery opens.
I have this js to toggle my classes by click:
<code>
$(function() {
$("#kuenstler").click(function(){
$("body").toggleClass("scrolled-down-20"); }).scroll();
});
</code>
This is the code provided by lightgallery:
<code>
var $lg = $('#lightgallery');
$lg.lightGallery();
// Perform any action just before opening the gallery
$lg.on('onBeforeOpen.lg',function(event){
alert('onBeforeOpen');
});
// custom event with extra parameters
// index - index of the slide
// fromTouch - true if slide function called via touch event or mouse drag
// fromThumb - true if slide function called via thumbnail click
$lg.on('onBeforeSlide.lg',function(event, index, fromTouch, fromThumb){
console.log(index, fromTouch, fromThumb);
});
</code>
snote