Skip to content

Instantly share code, notes, and snippets.

@steve21124
Created November 24, 2012 04:25
Show Gist options
  • Save steve21124/4138340 to your computer and use it in GitHub Desktop.
Save steve21124/4138340 to your computer and use it in GitHub Desktop.
function
jQuery(document).ready(function($){
var $masonry = $('#masonry');
$('#navigation').css({'visibility':'hidden', 'height':'1px'});
$masonry.masonry({
itemSelector : '.thumb',
isFitWidth: true
});
$masonry.infinitescroll({
navSelector : '#navigation',
nextSelector : '#navigation #navigation-next a',
itemSelector : '.thumb',
loading: {
msgText: '',
finishedMsg: '<?php _e('All items loaded', 'ipin') ?>',
img: '<?php echo get_template_directory_uri(); ?>/img/ajax-loader.gif',
finished: function() {},
},
}, function(newElements) {
$('#infscr-loading').fadeOut('normal');
$masonry.masonry('appended', $newElems, true);
});
$masonry.on('mouseenter', '.thumb-holder', function() {
$(this).children('.masonry-actionbar').show();
});
$masonry.on('mouseleave', '.thumb-holder', function() {
$(this).children('.masonry-actionbar').hide();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment