I've tried to find it elsewhere, but I did not find a solution that worked for me. The site is this:
These 3 squares at the top are places for the photos of the services provided to the last 3 clients (shown in slideshow). When I click on any of them, JavaScript makes an AJAX call to a PHP script that lists the images of the inserted folders as a 'date' attribute on the link. Each client has a folder with images. Yes, the site is static. I made a home lightbox to not use too many plugins (since I'm using jcycle). The problem is when I close the lightbox.
Whatever you're reading, go to the site by gentility (not yet optimized for smartphones and tablets) and click on one of the blue boxes at the top. It worked, did not it? Now click on the square in the upper right corner. You may notice that everything closes as expected. Now try clicking on any of the boxes. Most likely it did not work. I could not identify the error so far. Could anyone tell me why this is happening? It only works on the first click. Then just reloading the page: /
Here is the code:
<script type="text/javascript">
$(document).ready(function(){
$('.featured .client').on("click", function(e){
e.preventDefault();
$('body').addClass('active');
$('.modal').fadeIn();
$.ajax({
method: 'GET',
url: '/damaso-cod/gallery.php',
data: "main_dir=client_images&images_dir="+$(this).data('folder'),
success: function(data){
$('.modal').html(data);
$('.modal').cycle({
'next': '#next',
'prev': '#prev'
});
}
});
$('#close-btn').on("click", function(e){
e.preventDefault();
$('.modal').html('').cycle('reinit');
$('.filter').fadeOut();
$('body').removeClass('active');
});
});
});
</script>