palm mojo webos 中的滑动效果
我正在开发用于促销的画廊。我正在显示图像缩略图,并且单击图像变为全屏。现在我想滑动此图像以显示下一个全屏。我已经使用位置刷卡了。但它直接显示下一张图像,没有任何滑动/视觉效果/过渡。请帮我。
I am developing gallery for promotions. I am showing images thumbnail, And onclick image becomes fullscreen. Now i want to swipe this image to show next fullscreen. I have swiped already by using location. But it shows next image directly without any swiping /visual effect /transition. Please help me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否正在尝试实施轮播?虽然我这样做的方法是将前一个、当前和下一个图像打包到水平滚动条中(仅包含这三个子图像)。将滚动条对齐设置为 true。设置一个监听器,它将切换滚动条中的图像。
例如,给定九张图像,假设我们从查看第五张图像开始,滚动条将如下所示:
如果用户向左滑动,滚动条将捕捉到图像 6。 理想情况下,我们有这个模型:
但是,它是同时将所有图像加载到内存中并不总是可行的。在这种情况下,滚动条的填充方式如下:
4[5]6
当用户滚动查看图像 6 时,我们会在 6 后加载新图像(如果可用),然后删除图像 4。滚动条现在如下所示:
这应该提供基本的轮播行为。当用户到达图像列表的末尾时,侦听器可以简单地不加载下一个图像,并且滚动器将禁止滚动出界。
Are you trying to implement a carousel? While The way I'd go about doing this would be to pack the previous, current, and next image into a horizontal scroller (containg only these three child images). Set scroller snapping to true. Set up a listener, which will switch the images in the scroller.
For example, given nine images, and assuming we start by looking at the fifth images, the scroller will look like this:
If the user swipes left, the scroller will snap to image 6. Ideally, we have this model:
However, it is not always practical to load all images into memory at the same time. In this case, the scroller is populated like this:
4[5]6
When the user scrolls to view image 6, we load a new image after six (if available), and then remove image 4. The scroller now looks like this:
This should provide basic carousel behavior. The listener can simply not load the next image when the user reaches the ends of the image list, and the scroller will prohibit scrolling out of bounds.