我使用了一个jquery平滑的滚动效果,nothing fancy..just jQuery...and它似乎不能工作iPad或iPhone或任何其他的tablets..the网址在这里:http://teothemes.com/wp/viewpoint/
这是我在jquery平滑滚动中使用的代码:
jQuery(document).ready(function() {
jQuery("a[href*=#]").on('click', function() {
if(parseInt(jQuery(this.hash).offset().top) !== parseInt(jQuery(window).scrollTop()))
jQuery('html,body').animate({scrollTop:jQuery(this.hash).offset().top}, 1500);
});});
如果有任何人有任何想法,我们将非常感谢。
发布于 2012-09-02 20:02:06
你有没有尝试过CSS Property -webkit-overflow-scrolling:touch;?
发布于 2013-06-19 22:07:30
我读到这是一个iOS 6.1问题,在iOS 7的最早版本中似乎没有修复这个问题。我没有一个可靠的简单的解决方案,所以作为一个变通办法,我在检测到iPhones和iPods时使用Gentle Anchors,如果我发现其他设备需要它,我会更新这篇文章。
$('html, body').stop().animate({
'scrollTop': $target.offset().top }, 1000);
if( /iPhone|iPod/i.test(navigator.userAgent) ) {
Gentle_Anchors.Setup(target);
//for iPhone & iPod
}不幸的是,我看到一些卡顿,除非我告诉页面设置等于iPhone的肖像宽度在<head>中,如果其中一个设备已经被检测到。
发布于 2015-01-21 20:12:59
$(document).ready(function() {
$('.nav-wrapper ul li a').click(function(e) {
$('html,body').animate({ scrollTop: jQuery(this.hash).offset().top-134}, 500);
});
https://stackoverflow.com/questions/12235366
复制相似问题