监听导航滚动置顶

网友投稿 679 2022-09-06

监听导航滚动置顶

监听导航滚动置顶

1.js代码

/** * Created by EDUASK on 2016/5/20. */$(function(){ //引入id标签; var navtive=$("#native"); //设置导航标签为置顶; var offsetTop=navtive.offset()-; //定义一个监听高度; var scrollHeight=$(document).scrollTop; fn(navtive,offsetTop); //设置监听事件; $(window).scroll(function(){ fn(navtive,offsetTop); }); //调用方法; function fn(navtive,offsetTop){ var scrollHeight=$(document).scrollTop(); if(offsetTop>scrollHeight){ navtive.css("top",offsetTop); }else{ navtive.css("top",scrollHeight); } }});

2.html代码

监听导航滚动置顶

ddddd

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

欢迎访问我的导航条

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

回到顶部

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

aaaaaaaaaaaa

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:js中星期格式转换
下一篇:在SSRS 里实现 SUMIF(在SSRS中出现字符乱码的解决方法一般是)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~