aboutsummaryrefslogtreecommitdiffstats
path: root/public/javascripts/refinerycms-blog.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/javascripts/refinerycms-blog.js')
-rw-r--r--public/javascripts/refinerycms-blog.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/public/javascripts/refinerycms-blog.js b/public/javascripts/refinerycms-blog.js
new file mode 100644
index 0000000..b94977c
--- /dev/null
+++ b/public/javascripts/refinerycms-blog.js
@@ -0,0 +1,26 @@
+$(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
+ });
+ }
+ });
+ $('html, body').animate({
+ scrollTop: $('body').offset().top
+ }, 2000);
+ return false;
+ })
+}) \ No newline at end of file