aboutsummaryrefslogtreecommitdiffstats
path: root/public/javascripts/refinerycms-blog.js
blob: 5573915548c9692be28eb199ebb4daa4cdcb51f3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
$(document).ready(function(){
  $('#show_blog_post').height($('#show_blog_post').height());
  
  $('#next_prev_article a:not(".home")').live('click', function(){
    url = this.href + ".js";
    nav_url = $(this).attr('data-nav-url');
    $('#show_blog_post > *').fadeOut();
    $.ajax({
      url: url,
      success: function(data) {
        $('#show_blog_post').html(data);
        new_height = 0;
        $('#show_blog_post > *').each(function(){
          new_height += $(this).height()
        });
        $('#show_blog_post').animate({
          height: new_height
        });
      }
    });
    return false;
  })
})