0
我使用的剑道UI移动滚动条,但不知何故即时得到一个错误试图调用scrollviewer
moveTo
功能时剑道UI移动滚轮错误
Cannot call method 'moveTo' of undefined
我敢肯定,我已经在kendo.mobile.all.js引用(我使用Icenium剑道UI项目)
<div data-role="view" id="listview-headers" data-init="mobileListViewHeadersInit" data-title="Fixed Headers" data-model="viewModel" id="myView">
<a data-role="button" data-bind="click: scroll">Scroll to F</a>
<div data-role="scroller" style="height: 300px; margin: 0;" id="myScroller">
<ul id="fixed-listview"></ul>
</div>
</div>
<script>
$(function(){
var ViewModel = kendo.data.ObservableObject.extend({
scroll: function(e) {
console.log("scroll");
var pos = $("#M").position();
var scroller = $("#myScroller").kendoMobileScroller();
console.debug(scroller);
// this line below throws "Cannot call method 'moveTo' of undefined "
scroller.movable.moveTo({ x: pos.top, y: pos.left });
console.debug(pos);
}
});
$.extend(window, {
viewModel: new ViewModel(),
});
});
</script>