Reload Content in Masonry with jQuery append

//Reload Content in Masonry with jQuery append

Reload Content in Masonry with jQuery append

 jQuery('.leads').click(function(){
            jQuery('.blogspace').html('');
     var pagel = 1;
  var data = {
    action: 'my_getlatestleads',
            page: pagel,
  
  
  }
  
  jQuery.post(ajaxurl, data,function(response) {  
     
  
   var mediaItemContainer = jQuery( '#blog-masonry' ); 
        
  mediaItemContainer.masonry( {
      columnWidth:  200,
      itemSelector: '#post'
  } );

       jQuery(mediaItemContainer ).prepend(response);
  jQuery( mediaItemContainer ).masonry( 'reloadItems' );
  jQuery( mediaItemContainer ).masonry( 'layout' );
  
  
   console.log('leads');        
          
    
  
  
  }  );
  
By | 2014-07-11T20:57:33+00:00 July 11th, 2014|Categories: Wordpress 101 Guide|0 Comments

About the Author:

Leave A Comment