Skip to content

Instantly share code, notes, and snippets.

@bosskovic
Last active February 26, 2021 18:02
Show Gist options
  • Save bosskovic/6389878 to your computer and use it in GitHub Desktop.
Save bosskovic/6389878 to your computer and use it in GitHub Desktop.
$(document).ready(function() {
var $container = $('#translators')
$($container).isotope({
itemSelector: '.item',
masonry: {
columnWidth: 280
}
})
$container.infinitescroll({
navSelector: '#page_nav',
nextSelector: '#page_nav .pagination .next_page a',
itemSelector: '.item',
pixelsFromNavToBottom: -Math.round($(window).height() * 0.9),
bufferPx: Math.round($(window).height() * 0.9),
loading : {
msgText : $container.attr("data-loading-message"),
finishedMsg: $container.attr("data-no-more-translators")
}
},
function(newElements) {
$container.isotope('appended', $(newElements))
}
)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment