javascript - trigger click? autoload lightbox -
i don't understand jquery, i'm using lightbox here , want first photo open when page loads.
when used fancybox before, trigger click , work
$(document).ready(function() { $(".fancybox").fancybox({ }); // launch fancybox on first element $(".fancybox").eq(0).trigger('click'); }); so tried same thing lightgallery
$(document).ready(function() { $("#lightgallery").lightgallery({ }); $("#lightgallery").eq(0).trigger("click"); }); but doesn't work
the whole thing here (i'm sure it's huge mess, i'm kind of fumbling way through it).
i tried few different solutions on here (window.load 1 think) don't understand enough know whether solution isn't working or i'm missing '{' or stupid thing
$('#lightgallery img:eq(0)').click() should it.
Comments
Post a Comment