【发布时间】:2013-03-04 18:12:01
【问题描述】:
当我尝试在我的 android 手机中向下滑动时,我的 iscroll 对象不会向下滑动到底部,但与底部有一段距离。 HTML 模板如下:
/*The HTML template code like this:*/
<div class="content">
<div class="scroller">
<div class="div1">
</div>
</div>
</div>
/*The javascript code like this:*/
$.get(url, function(html){
_this.$('.div1').html(html);
_this.$('.div1').css('display','inline-block');
var width=_this.$('.div1').width()||'400px';
var height=_this.$('.div1').height()||'900px';
//height+=210;
if(width<=400)width=400;
_this.$('.div1').css('width',width);
_this.$('.div1').css('height',height);
_this.$('.scroller').css('width',width);
_this.$('.scroller').css('height',height);
if(html.indexOf('errorpage')<=0)
_this.$('.div1').addClass('padding-all-4px');
setTimeout(function () {
_this.scroll = new iScroll(_this.$('.content')[0],{
hScroll: true,
vScroll: true,
lockDirection: false,
zoom: true,
zoomMin: 0.5,
zoomMax: 4,
doubleTapZoom: 2
});
}, 0);
});
【问题讨论】:
-
我们不是读心术的变种人,亲爱的。请放置一些代码来检查并使您的问题足够清楚... :)
-
你能解释一下 iscroll 是如何滚动的吗?谢谢你。
标签: javascript swipe iscroll