www.3112.net > jquEry $(winDow).sCrolltop()Ϊʲôһֱ0

jquEry $(winDow).sCrolltop()Ϊʲôһֱ0

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

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

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

ƪҪjQuery scroll¼ʵּعҳʾ,ʹajax,ͬʱ(document).height()$(window).height(),ҪѿԲο scroll¼window󣬵ҲɹiframeCSS overflowΪscr...

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

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

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

$(function() { $(window).scroll(function(){ var scrolltop=$(this).scrollTop(); if(scrolltop>=200){ $("#elevator_item").show(); }else{ $("#elevator_item").hide(); } });

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

jquery #Float {background-color: #000;height: 200px;width: 100px;position: absolute;top: 80px;right: 20px;} $(document).ready(function(){ $(window).scroll(function (){ // ø봰ڶʼձ80px var offsetTop ...

վͼ

All rights reserved Powered by www.3112.net

copyright ©right 2010-2021
www.3112.net磬ַϵͷzhit325@qq.com