fkjj.net
ǰλãҳ >> jquEry sCrolltop ΪʲôûЧ >>

jquEry sCrolltop ΪʲôûЧ

취 ԪΪɼ״̬el.style.display='block'Ϳԭel.scrollTopԻjQueryscrollTopˡ

$(window).on('scroll',function(){ console.log($(window).scrollTop()); }) Ҫһ¼

scrollTopjqueryеúõʱҪjqueryڿ⣻Ȼ÷ $(document).ready(function(){ $(".btn1").click(function(){ $("div").scrollTop(100); }); $(".btn2").click(function(){ alert($("div").scrollTop()+" px"...

ֻquirkģʽ£ body.scrollTopDZжֵ֧ Ҳ ҲûбҪȥǣ ֻҪסһ if(window.pageYOffset){//һȥ˴󲿷֣ ֻIE678 }else if(document.documentElement.scrollTop ){//IE678 ķquirkģʽ }...

$(".dh4").click(function(){ $('body,html').animate({scrollTop:670},500); return false; }) ʱ붥670pxλãһǸdiv붥ֱ

var scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop;

ޱĵ $(document).ready(function(){ for(var i=1;i

ɡ ҪbodyĹ¼ $(function(){ var min_height = 100; $(window).scroll(function() { //ȡڵĹĴֱλ var s = $(window).scrollTop(); //ڵĹĴֱλôҳС߶ʱ...

ڵڶҳҪжϹ ˼ÿιɺҪסscrollTop ȻźжϹ û취Ϲ....

ԭ html˸߶ʱȡ$(window).scrollTop(),$(document).scrollTop()ȡֵΪ0 취 ֵ $(document).ready(function() { $(window).scroll(function(e){ var juantop=$(document).scrollTop() alert(juantop)...

վҳ | վͼ
All rights reserved Powered by www.fkjj.net
copyright ©right 2010-2021
磬ַϵͷzhit325@qq.com