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');        
          
    
  
  
  }  );