hgnl96 hgnl96 - 2 years ago 124
Javascript Question

Shuffle.js function after Ajax call

I use this library: http://vestride.github.io/Shuffle/, works good, but the the problem I have now is, I have a load more button, for loading more images.

It is made with Ajax, but when I call the function again after the Ajax call, the grid is not updated:


My shuffleGrid function:

shuffleGrid = function(){
var $grid = $('#block .content');

itemSelector: '.views-row'

Answer Source

Problem solved by do this:

    $('#block .content .views-row:not(.shuffle-item)').each(function() {
        var $newRow = $(this);

        $('#block .content').append($newRow);
        $('#block .content').shuffle('appended', $newRow);  
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download