Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function custom_masonry_js() { ?>
- <script type="text/javascript">
- jQuery(document).ready(function(){
- var $container = jQuery('#sort');
- $container.imagesLoaded(function(){
- $container.masonry({
- itemSelector: '.box',
- columnWidth: 100
- });
- });
- $container.infinitescroll({
- navSelector : '.navigation', // selector for the paged navigation
- nextSelector : '.navigation .nav-previous a', // selector for the NEXT link (to page 2)
- itemSelector : '.box', // selector for all items you'll retrieve
- loading: {
- finishedMsg: 'No more pages to load.',
- img: 'http://www.stemtechtestimonials.com/wp-content/themes/shaken-grid-free/images/ajax-loader.gif'
- }
- },
- // trigger Masonry as a callback
- function( newElements ) {
- // hide new items while they are loading
- var $newElems = jQuery( newElements ).css({ opacity: 0 });
- // ensure that images load before adding to masonry layout
- $newElems.imagesLoaded(function(){
- // show elems now they're ready
- $newElems.animate({ opacity: 1 });
- $container.masonry( 'appended', $newElems, true );
- });
- }
- );
- });
- </script>
- <?php
- }
Advertisement
Add Comment
Please, Sign In to add comment