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

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

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

ԭ 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붥ֱ

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

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

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

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

jQueryȡط jquery ȡ߶ ȡʾĸ߶ $(window).height(); ȡʾĿ $(window).width(); ȡҳĵ߶ $(document).height(); ȡҳĵ $(document).width(); ...

Ҫˣڵ㱾scrollTopԣҲǿֵָ

ضΪbodyscrollTopΪ0 ЧanimateJqueryԶ嶯 $("#returnTop").click(function () { var speed=200;//ٶ $('body,html').animate({ scrollTop: 0 }, speed); return false; });עreturnTopΪ...

վͼ

All rights reserved Powered by www.3112.net

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