Advertisement
sastranababan

More Charity Function

Nov 27th, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.                 $('#more-charity').click(function (ev) {
  2.                    var form = $('#charity-form');
  3.                    var $container = $('#charity-result');
  4.                    var $button= $(this).button('loading');  
  5.                     $.ajax({
  6.                         type: "GET",
  7.                         cache: false,
  8.                         url: "http://localhost/simplygiving/data/charities.dta",
  9.                         success: function (response) {
  10.                           var $container = $('#charity-result');
  11.                           newItems=$(response);
  12.                          
  13.                                   if (window.discoverMode != "list"){
  14.                                     $container.append( newItems ).isotope( 'appended',newItems);
  15.                                   }else{
  16.                                      for ( var i = 0, l = newItems.length; i < l; i++ ) {
  17.                                         $(newItems[i]).removeClass( "grid col-md-4 col-sm-4 " ).addClass( "list" );  
  18.                                      }
  19.                                      $container.append( newItems ).isotope( 'appended',newItems);
  20.                                   }
  21.                            $button.button('reset');
  22.                           }  
  23.                         });
  24.  
  25.                     ev.preventDefault();
  26.  
  27.                 });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement