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)...

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

$(".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...

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

취 ԪΪɼ״̬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(); } });

ãҪȷһҪjQueryscrollTopȡඥ˵ľ룬ҪʹscrollTopùඥ˵ľ룬˵Ҫ߼汸 1ǻȡԭjsʵֺף var div = document.getElementById('wgt-ask'), scrollTop ...

jsʵ $(function () { showScroll(); function showScroll() { $(window).scroll(function () { var scrollValue = $(window).scrollTop(); scrollValue > 100 ? $('div[class=scroll]').fadeIn() : $('div[class=scroll]').fadeOut()...

վͼ

All rights reserved Powered by www.3112.net

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