Advertisement
kaed

animeSeries - active.js

May 30th, 2013
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.83 KB | None | 0 0
  1. jQuery(function($){
  2.     var $content = $('#alphebatized');
  3.     var load_posts = function(l){
  4.         if(l === ''){
  5.             l='A';
  6.         }
  7.         $.ajax({
  8.             type: "GET",
  9.             data: {letter: l},
  10.             dataType: "html",
  11.             url: "http://localhost/permendrain/wp-content/themes/animeSeries/first-letter.php",
  12.             beforeSend: function(){
  13.                 $content.fadeOut('fast');
  14.             },
  15.             success: function(data){
  16.                 $data = $(data);
  17.                 if ($data.length){
  18.                     $data.hide();
  19.                     $content.html('');
  20.                     $content.append($data);
  21.                     $content.fadeIn('fast');
  22.                     $data.fadeIn('fast');
  23.                 }
  24.             },
  25.             error: function(jqXHR, textStatus, errorThrown) {
  26.                 alert(jqXHR + " :: " + textStatus + " :: " + errorThrown);
  27.             }
  28.         });
  29.     }
  30.    
  31.     $('#sort-by a').click(function() {
  32.         var l = $(this).attr('name'); //letter from button
  33.         load_posts(l);
  34.     });
  35.    
  36.     load_posts('');
  37. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement