我正在使用以下代码:
$(window).scroll(function () {
if (($(document).height() - $(window).scrollTop()) <= 500){
$("#content-5").css({
position: 'fixed',
top: 'auto',
bottom: '300px'
});
} else if ($(window).scrollTop() >= 30) {
$("#content-5").css({
position: 'fixed',
top: '30px',
bottom: 'auto'
});
}else{
$("#content-5").css({
position: 'absolute',
top: '30px',
bottom: 'auto'
});
}});
这是演示
http://jsfiddle.net/Ym2Ga/75/
它的工作很好,但我不知道该怎么做,浮子不能停在脚上。有人能帮忙吗?
发布于 2014-07-27 11:29:47
我已经向你更新了fiddle....change你的第一个css块.
$("#content-5").css({ position: 'fixed', top: '0px', bottom: 'auto' });
手摇
https://stackoverflow.com/questions/24980340
复制相似问题