From 2f94c8c08aec64403fdecf3a13d20dc35a595fb5 Mon Sep 17 00:00:00 2001 From: Joe Sak Date: Sat, 20 Nov 2010 13:59:27 -0600 Subject: ajaxify the nav --- public/javascripts/refinerycms-blog.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 public/javascripts/refinerycms-blog.js (limited to 'public') diff --git a/public/javascripts/refinerycms-blog.js b/public/javascripts/refinerycms-blog.js new file mode 100644 index 0000000..f55e279 --- /dev/null +++ b/public/javascripts/refinerycms-blog.js @@ -0,0 +1,22 @@ +$(document).ready(function(){ + height = $('#show_blog_post').height(); + $('#show_blog_post').height(height); + $('#next_prev_article a:not(".home")').click(function(){ + url = this.href + ".js"; + nav_url = $(this).attr('data-nav-url'); + $('#show_blog_post, #next_prev_article').fadeOut(); + $.ajax({ + url: url, + success: function(data) { + $('#show_blog_post').html(data).fadeIn().height('auto'); + $.ajax({ + url: nav_url, + success: function(data) { + $('#next_prev_article').html(data).fadeIn(); + } + }) + } + }); + return false; + }) +}) \ No newline at end of file -- cgit v1.2.3