// JavaScript Document
$(document).ready(function(){
$(this).scroll(function(){
var currentWindowHeight=$(window).height();
var currentMoveHeight=$(document).scrollTop()
var aside_height=$("aside").height();
var currentMoveLeft=$(document).scrollLeft();
var currentMainHeight=$(document).height();
if(currentMoveHeight>(aside_height-currentWindowHeight))
{
$("aside").css("position","fixed");
$("aside").css("bottom","0px");
if(currentMoveLeft>0){
$("aside").css("position","relative");
}
}
else{
$("aside").css("position","relative");
$("aside").css("bottom","auto");
}
});
});
仿CSDN侧边栏滚轮响应脚本
This article was last edited at 2020-01-24 22:02:50