Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 8th, 2012  |  syntax: None  |  size: 1.31 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Change content with Jquery (Paginate)
  2. <div class="pagination">
  3.     <a href="test.php">clik2</a>
  4.   </div>
  5.        
  6. var hash = window.location.hash.substr(1);
  7. var href = $('.pagination a').each(function(){
  8.     var href = $(this).attr('href');
  9.     if(hash==href.substr(0,href.length-5)){
  10.         var toLoad = hash+'.html #content';
  11.         $('#content').load(toLoad)
  12.     }                                          
  13. });
  14.  
  15.         $('.pagination a').click(function(){
  16.  
  17.             var toLoad = $(this).attr('href')+' #content';
  18.             $('#content').hide('1000',loadContent);
  19.             $('#load').remove();
  20.             $('#wrapper').append('<span id="load"></span>');
  21.             $('#load').fadeIn('slow');
  22.             window.location.hash = $(this).attr('href').substr(0,$(this).attr('href').length-5);
  23.                 function loadContent() {
  24.                     $('#content').load(toLoad,'',showNewContent())
  25.                 }
  26.                 function showNewContent() {
  27.                     $('#content').delay(100).show('fast',hideLoader());
  28.                     $(window).scrollTop('');
  29.                 }
  30.                 function hideLoader() {
  31.                     $('#load').delay(300).fadeOut('fast');
  32.                 }
  33.             return false;
  34.     });
  35. });
  36.        
  37. $('.pagination a').click(
  38.        
  39. $('.pagination a').live('click',function() {