D
D
Dmitry2015-08-15 15:03:58
css
Dmitry, 2015-08-15 15:03:58

How to make ajax fancybox gallery?

Actually, it is necessary that the link opens the fancybox gallery, but the pictures must be loaded via ajax in order not to load the page, since there will be many such blocks

<div class="item-wr">
    <a href="" class="button fancy-link">Посмотреть галерею</a>
    
    <!-- эти картинки должны подгружаться через ajax -->
    
    <img class="img-gallery" src="img-1" alt="">
    <img class="img-gallery" src="img-2" alt="">
    <img class="img-gallery" src="img-3" alt="">  
</div>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mak Alexey, 2015-08-15
@S-ed

It already has AJAX content loading

$('#button').on('click', function(){
    $.fancybox({
        width: 400,
        height: 400,
        autoSize: false,
        href: 'http://www.example.com/some-ajax-data.php',
        type: 'ajax'
    });
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question