How to make a Fotorama slider after closing the modal window started showing from the first photo?

Hello! Use the fotorama slider in the popup window.

The slider code:

<div id="foto" class="overlay js-overlay-thank-you">
 <div class="fotorama fotorama-style js-thank-you" data-nav="thumbs" data-auto="false" data-width="800" data-height="600">
 <a href="#close" title="Close" class="close">X</a>
</div>
 <div class="close-popup js-close-thank-you"></div>
 </div>


Take photo:
$('.fotorama').fotorama({ data: [ 
 {img: 'img/gallery/2/1.jpg'}, 
 {img: 'img/gallery/2/2.jpg'} 
 ] })


Cause by clicking on the link:
$('.sl-fotorama').click(function() { 
$('.js-overlay-thank-you').fadeIn();
});


Hide on click:

$(document).mouseup(function (e) { // by clicking outside the pop-up when PC
 var popup = $('.fotorama');
 if (e.target!=popup[0]&&popup.has(e.target).length === 0){
$('.js-overlay-thank-you').fadeOut();
}
});

The problem: if you open the slider, scroll through the pictures and close, the next time the show will nachinaetsya with the picture, which was closed, and not with the first. How to reset the value of the slider when closing a modal window?
June 8th 19 at 16:37
0 answer

Find more questions by tags JavaScript