需要带有 HTML 和 AJAX 的 Jquery Carousel [滑块动画]
我需要一个 jquery 插件,我想在默认情况下以 HTML 形式加载模块,并且在单击更多链接时,它应该通过 AJAX 加载其余内容,然后应启用上一个按钮。
目前,当我谷歌时,我可以获得很多插件,这些插件只需通过 AJAX 或动画加载[通过隐藏其余内容]。但出于性能问题,我不想一次性加载所有内容,然后加载动画。所以我想加载 5 li,点击“更多”后,它应该开始加载剩余的内容,但它也应该有动画。
有人可以帮我解决这个问题吗?
——巴拉
i need a jquery plugin where i want to load the module by default as HTML and upon clicking more link it should load the rest of the content via AJAX and then previous button should be enabled.
Currently when i google i can get lot of plugin which just load either via AJAX or Animation [by hidding the rest of the content]. But for performance issue i don't want to load all the content at one shot and then animation. So i want to load the 5 li's and upon clickiing "More" it should start loading the remaining content but it should also animation.
Could someone help me on this?
-- Bala
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我给您的建议是根据您的需求定制 jCarousel。具体来说,当您最初渲染页面时,您可以包含轮播的最初 5 个元素。然后,在轮播的 onchange 事件中,到达最后一张幻灯片后,您可以使用 AJAX 拉入其他图像。
根据您的需求,使用由平面 JavaScript 数组驱动的 jCarousel 可以节省一些加载时间,因为图像 URL 将在原始标记中呈现,但在将它们添加到轮播的可见部分之前不会由浏览器下载。无需 AJAX。 这是一个演示。
My advice to you would be to customize the jCarousel according to your needs. Specifically, when you render the page initially you can include the initial 5 elements of your carousel. Then, in the carousel's onchange event, once you reach the last slide you can use AJAX to pull in the additional images.
Depending on your needs, using jCarousel driven by a flat JavaScript array you could save some load time as the image URLs would be rendered in the original markup, but not downloaded by the browser until they are added to the visible portion of the carousel. No AJAX required. Here's a demo.