Reputation: 23
Im using this code:
$(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'
});
}
});
And this is demo
Its work fine, but i don't know how to do, that float elemnt stop at footer. Anyone can help?
Upvotes: 0
Views: 183