如何捕获在iP​​hone / Android的滚动开始事件事件、iP、hone、Android

由网友(地獄的境界)分享简介:我使用jQuery与移动网站的重新定位上滚动的标题导航在没有位置:固定支撑。工作正常,当用户停止滚动的标题被放回在页面的顶部。I'm using JQuery with a mobile site to reposition the header nav on scroll in the absence of pos...

我使用jQuery与移动网站的重新定位上滚动的标题导航在没有位置:固定支撑。工作正常,当用户停止滚动的标题被放回在页面的顶部。

I'm using JQuery with a mobile site to reposition the header nav on scroll in the absence of position:fixed support. That works fine, when the user stops scrolling the header is placed back at the top of the page.

要加强经验我想隐藏()的标头中的用户,当用户的启动的滚动,然后把它滑入当他们停止。问题是,当用户停止滚动滚动事件仅触发。我读过,有iOS的特定触摸事件,但有什么办法,我可以捕获iOS和Android采用相互共同code?

To enhance the experience for the user I want to hide() the header when the user starts to scroll and then have it slide in when they stop. The problem is that the scroll event only fires when the user stops scrolling. I've read that there are iOS specific touch events but is there any way I can capture a scroll start event on iOS and Android using mutually common code?

感谢

推荐答案

我相信 jQuery Mobile的,能做到这一点。看看下面的code:

I believe jQuery Mobile, can do this. Take a look at the following code:

$(document).bind("scrollstop", function() {

//What occurs when the scrolling stops
alert("You have stopped scrolling");
});

$(document).bind("scrollstart", function() {

//What occurs when the scrolling starts
alert("You have started scrolling");

});
阅读全文

相关推荐

最新文章