为什么使用 JQTouch 滚动图像会跳动?

发布于 2024-10-03 22:13:13 字数 923 浏览 0 评论 0原文

我有一堆垂直行的图像,当你滑动到 滚动它们并不顺畅。它往往会跳起来一点 每张照片都映入眼帘。

然而,一旦我滚动浏览图像并备份,第二次就很顺利,就像它们被缓存了一样。我尝试预加载图像,没有任何变化。

有什么想法吗?谢谢。

<div id="pics">
<div class="toolbar">
<a href="#" class="back">Back</a>
<h3>Pics</h3>
</div>
<div id="wrap">
<h1 class="picname">Pic name</h1>
<p class="date">Jan 1, 2010</p>
<img src="1.png">

<h1 class="picname">Pic name</h1>
<p class="date">Jan 10, 2010</p>
<img src="10.png">

<h1 class="picname">Pic name</h1>
<p class="date">Jan 11, 2010</p>
<img src="11.png">

<h1 class="picname">Pic name</h1>
<p class="date">Jan 14, 2010</p>
<img src="14.png">

<h1 class="picname">Pic name</h1>
<p class="date">Jan 17, 2010</p>
<img src="17.png">
</div>
</div>

I have a bunch of images in a vertical row, and when you swipe to
scroll though them it's not smooth. It tends to jump up a little as
each pic comes into view.

However, once I scroll thru the images and back up it is smooth the second time around, like they are cached or something. I tried pre-loading images with no change.

Any ideas? Thanks.

<div id="pics">
<div class="toolbar">
<a href="#" class="back">Back</a>
<h3>Pics</h3>
</div>
<div id="wrap">
<h1 class="picname">Pic name</h1>
<p class="date">Jan 1, 2010</p>
<img src="1.png">

<h1 class="picname">Pic name</h1>
<p class="date">Jan 10, 2010</p>
<img src="10.png">

<h1 class="picname">Pic name</h1>
<p class="date">Jan 11, 2010</p>
<img src="11.png">

<h1 class="picname">Pic name</h1>
<p class="date">Jan 14, 2010</p>
<img src="14.png">

<h1 class="picname">Pic name</h1>
<p class="date">Jan 17, 2010</p>
<img src="17.png">
</div>
</div>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

走走停停 2024-10-10 22:13:13

这是 jqtouch 的问题,你不能大幅改变尺寸,我在动态加载内容时遇到了这个问题,可能有两种解决方案:

  • 提供图像尺寸
  • 使用 onload/onabort 处理程序逐个加载图像以转到下一个图像

It is an issue with jqtouch, you can not change sizes drastically, I had that issue with dynamically loaded content, there are probably two solutions:

  • provide image sizes
  • load images one by one using onload/onabort handlers to go to next image
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文