本文由 资源共享网 – admin 发布,转载请注明出处,如有问题请联系我们!jQuery网页向下滚动导航固定顶部代码
资源语言: 中文
导航筛选资源(jQuery网页向下滚动导航固定顶部代码)网址:https://www.08i8.com/ttqdzy/detail10569.html;转载请注明!
jQuery网页向下滚动导航固定顶部代码是一款利用监测scrollTop距离进行导航栏的fixed固定来实现的js网站特效。
js代码
<script> $(function(){ var a = $("#nav"), b =a.offset(); $(document).on("scroll",function(){ var c = $(document).scrollTop(); if(b.top<=c){ a.css({"position":"fixed","top":"0px"}) }else{ a.css({"position":"absolute","top":"300px"}) } }) }) </script>
导航筛选资源(jQuery网页向下滚动导航固定顶部代码)网址:https://www.08i8.com/ttqdzy/detail10569.html;转载请注明!