Last active
February 7, 2018 20:02
-
-
Save jekey123/b81d96796cb7c7f79eb2c5ea303d4221 to your computer and use it in GitHub Desktop.
Ultimate Member Infinite Scroll Member Directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-infinitescroll/2.1.0/jquery.infinitescroll.min.js" defer="defer"></script> | |
<script type="text/javascript"> | |
(function() { | |
function waitDefer(method) { | |
if (window.jQuery && window.jQuery.fn.infinitescroll) | |
method(); | |
else | |
setTimeout(function() { waitDefer(method) }, 50); | |
} | |
waitDefer(function() { | |
var grid = jQuery(".um-members"); | |
if (grid.length) { | |
jQuery('.um-members-pagi').hide(); | |
grid.infinitescroll( | |
{ | |
navSelector: '.um-members-pagi', | |
nextSelector: '.um-members-pagi .pagi.current+a', | |
itemSelector: '.um-member', | |
loading: { | |
finishedMsg: "<em>Congratulations, you've reached the end of the internet.</em>", | |
msgText: "<em>Loading new items...</em>", | |
speed: 'fast', | |
} | |
}, | |
function(new_elts) | |
{ | |
var elts = jQuery(new_elts).css('opacity', 0); | |
elts.animate({ opacity: 1 }); | |
grid.masonry('appended', elts); | |
jQuery('body').trigger('post-load'); | |
grid.masonry('layout'); | |
}); | |
} | |
}); | |
})(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Simply put this code in footer to activate infinte scroll and get rid of pagination in Ultimate member directory.