计划:月食(PhoneGap的)iScroll不断向上滚动回(PhoneGap的)
电话:HTC渴望(2.2.2)
我一直在用了一段时间的iscroll插件玩耍,但现在它似乎我无法得到它的工作。当我在Android模拟器和手机中测试它时,它会一直滚动回顶端。另外,logcat中给出了如下一行:
“小姐一拖,因为我们正在等待的WebCore的触摸响应向下”
的Javascript:
<script type="text/javascript">
var theScroll;
function scroll() {
theScroll = new iScroll('scroll-content', { snap:true, momentum:false, hScrollbar:false, vScrollbar:false});
setTimeout(function() { theScroll.refresh() }, 0);
}
document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
document.addEventListener('DOMContentLoaded', scroll, false);
</script>
HTML:
<div id="wrapper">
<div id="main-content">
<div id="pages">
<div id="map" class="current">
</div>
<div id="camera">
<button class="camera-control" onclick="capturePhoto();">Capture Photo</button>
<div style="text-align:center; margin:20px 0 0 0;">
<img id="cameraPic" src="" style="width:50%; height: 50%;"/>
</div>
</div>
<div id="buzz">
<div id="scroll-content">
<ul id="your-tweets"></ul>
</div>
</div>
<div id="info">
<p>Informatie Evident</p>
</div>
</div>
</div>
</div>
我使用JSON调用推文来填充列表。希望somebodey可以帮助!
同样的问题。我的解决方法描述如下: http://stackoverflow.com/questions/14348530/initializing-iscroll-with-phonegap-and-jquery-mobile/18726683#18726683 – Plamen