javascript 位置:固定al llegar scrolleando a cierto punto
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了javascript 位置:固定al llegar scrolleando a cierto punto相关的知识,希望对你有一定的参考价值。
$(window).scroll(function(e){
$el = $('.fixedElement');
if ($(this).scrollTop() > heightalaqseponefixed && $el.css('position') != 'fixed'){
$('.fixedElement').css({'position': 'fixed', 'top': '0px'});
}
if ($(this).scrollTop() < heightalaqseponefixed && $el.css('position') == 'fixed'){
$('.fixedElement').css({'position': 'absolute', 'top': '0px'});
}
});
以上是关于javascript 位置:固定al llegar scrolleando a cierto punto的主要内容,如果未能解决你的问题,请参考以下文章
JavaScript 模拟位置:用底部固定(jquery)
位置固定页脚,不带JavaScript
javascript 在没有Jquery的情况下停止页脚的固定位置
javascript 在没有Jquery的情况下停止页脚的固定位置
带有固定节点的 Javascript cytoscape.js 自动布局
Jquery实现相对浏览器位置固定悬浮