fkjj.net
ǰλãҳ >> jquEry $(winDow).sCrollTop()Ϊʲôһֱ0 >>

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

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

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

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

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

ĸ߸ij$(document).width()

Ҫһϱʶ൱ҪһΧ磺 $('li').index(document.getElementById('bar')); //1һDOM󣬷ԭȼеλ$('li').index($('#bar')); //1һjQuery$('li').index($('li:gt(0)'...

readyд $('#content').scrollTop( $('#content')[0].scrollHeight );

jQuery һ㹻ˡһ scrollTop(0) ԭˣֹˢλò䡣 $("html, body").scrollTop(0).animate({scrollTop: $("#scroll").offset().top});

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

ο£ ȡʾĸ߶ $(window).height(); ȡʾĿ $(window).width(); ȡҳĵ߶ $(document).height(); ȡҳĵ $(document).width(); ȡĴֱ߶ $(document...

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