1 line
1.7 KiB
JavaScript
1 line
1.7 KiB
JavaScript
$.browser.msie&&$.browser.version<"9.0"&&$("html").addClass("ie"),$(document).ready(function(){$(".sidebar").masonry({singleMode:!0}),arrivedAtBottom=$(window).scrollTop()>=$(document).height()-$(window).height()-30,$(window).scroll(function(o){o.stopPropagation(),arrivedAtBottom=$(window).scrollTop()>=$(document).height()-$(window).height()-30,arrivedAtBottom?($(".totop").removeClass("go_bottom"),$(".totop").addClass("go_top")):($(".totop").removeClass("go_top"),$(".totop").addClass("go_bottom"))}),$(".totop").click(function(){arrivedAtBottom?$("html,body").animate({scrollTop:0},500):$("html,body").animate({scrollTop:$(document).height()-$(window).height()},500)}),$(".tocomments").click(function(){$("html,body").animate({scrollTop:$(".comments").offset().top-40},500)}),$body=window.opera?"CSS1Compat"==document.compatMode?$("html"):$("body"):$("html,body"),$(document).on("click","#comments-nav a",function(o){o.preventDefault(),$.ajax({type:"GET",url:$(this).attr("href"),beforeSend:function(){$("#comments-nav").remove(),$("#loading-comments").slideDown()},dataType:"html",success:function(o){$(".comment-list").remove(),result=$(o).find(".comment-list"),nextlink=$(o).find("#comments-nav"),$("#loading-comments").slideUp(550),$("#loading-comments").after(result.fadeIn(800)),$(".comment-list").after(nextlink)}})}),$(document).on("click","#posts-nav a",function(o){o.preventDefault(),$.ajax({type:"GET",url:$(this).attr("href"),beforeSend:function(){$("#posts-nav").remove(),$("#loading-posts").slideDown()},dataType:"html",success:function(o){$(".posts-list").remove(),result=$(o).find(".posts-list"),nextlink=$(o).find("#posts-nav"),$("#loading-posts").slideUp(550),$("#loading-posts").after(result.fadeIn(800)),$(".posts-list").after(nextlink)}})})}); |