Reputation: 362
I use the great LightGallery js module: https://github.com/sachinchoolur/lightGallery https://sachinchoolur.github.io/lightGallery/
How can I start LightGallery in fullscreen mode? Fullscreen mode can be activated by clicking the icon in the toolbar, but how to start a slideshow in full-screen mode?
Upvotes: 1
Views: 3227
Reputation: 8481
I've found the following answer posted by plugin's author (sachi77n) in the comments section of the official page (https://sachinchoolur.github.io/lightGallery/).
I'll post it here for anyone that tries to achieve this functionality.
You can trigger the fullscreen function on lightGallery's onAfterOpen.lg
event.
$(document).ready(function() {
var $lg = $('#lightgallery');
$lg.lightGallery();
$lg.on('onAfterOpen.lg', function(){
$lg.data('lightGallery').modules.fullscreen.requestFullscreen();
});
});
Demo: http://codepen.io/anon/pen/xgEBZq.
Upvotes: 4