使用isroll4将最后一个元素滚动到第一个元素的开始位置

using iScroll 4 scroll the last element to the start position of first element

本文关键字:元素 第一个 开始 位置 滚动 isroll4 最后一个 使用      更新时间:2023-09-26

我现在使用isroll 4从http://cubiq.org/iscroll-4在触摸设备中启用滚动。问题是最后一个元素没有正确出现。我想让最后一个元素滚动到滚动的开始位置。我不知道该怎么做。最后一个元素没有到达屏幕宽度的中心。我已经将第一个元素定位到屏幕的中心。谢谢你的帮助。

我们只需要做(Screen width - Element width) + (Number of elements*Element width)将最后一个元素带到滚动的开始位置。在这里,在我的例子中,屏幕中心