动态水平扩展 jCarousel Lite 轮播幻灯片脚本

发布于 2024-09-16 09:06:12 字数 401 浏览 6 评论 0原文

我想使用名为“jCarousel Lite”的 jQuery 插件构建轮播幻灯片(http://www. gmarwaha.com/jquery/jcarousellite/)。我已经启动并运行了。诀窍是,我还想构建一个 YouTube 式的“展开”按钮,该按钮可以放大该幻灯片以填充页面的整个宽度。

到目前为止,我已经使用 jQuery 成功构建了这样一个展开按钮。问题是,“下一个”和“上一个”按钮仍然只能滑动轮播第一次初始化时定义的距离。显然,由于宽度更宽,这些需要滑动更长的距离。

因此,本质上我需要的是有关如何在轮播首次初始化后更改“下一个”和“上一个”按钮滑动距离的信息。

I want to build a carousel slideshow using the jQuery plugin called "jCarousel Lite" (http://www.gmarwaha.com/jquery/jcarousellite/). I have this up and running. The trick is, I want to also build a YouTube-esque "expand" button, which scales this slideshow up to fill the full width of the page.

So far, using jQuery, I’ve managed to build just such an expand button. The problem is, the “next” and “previous” buttons still only slide the distance that was defined when the carousel was first initialized. Obviously, these need to slide a longer distance, now that the width is wider.

So essentially what I need is information as to how I can change the distance the “next” and “previous” buttons slide, after the carousel has first been initialized.

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

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

发布评论

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

评论(1

一桥轻雨一伞开 2024-09-23 09:06:12

所以,我可能已经找到了“扩展”问题的半解决方案。

重新初始化幻灯片不起作用。我找不到(或挂钩)定义每张幻灯片在每次下一个/上一个单击时移动多远的变量。

所以我的解决方案是以扩大的尺寸嵌入幻灯片,但内部图像较小。单击展开按钮时,我没有展开幻灯片本身,而是展开了其中的项目。将其与设置为小宽度和溢出:隐藏的包含 div 结合起来,一切工作几乎完美。

So, I may have found a semi-solution to my "expand" problem.

Reinitializing the slideshow didn't work. I couldn't find (or hook in to) the variable that defines how far each slide travels on each next/prev click.

So my solution was to embed the slideshow at its expanded size, but with smaller images inside. On clicking my expand button, I didn't expand the slideshow itself, only the items inside. Combine this with a containing div which was set to the small width and overflow: hidden, things worked almost perfectly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文