基于 jquery 的 HTML 内容幻灯片/过渡

发布于 2024-09-12 00:52:18 字数 133 浏览 13 评论 0原文

基于JQuery搜索rotator只能找到原始的rotator插件和一堆照片库,这是我不想要的。请推荐其他可用的旋转器。旋转器应该能够旋转 HTML,而不仅仅是图像(例如 Glimmer 工具,它可以创建用于旋转图像的 JQuery/HTML 代码)。

Searching for rotators based on JQuery only finds the original rotator plugin and a bunch of photo galleries, which I don't want. Please suggest other rotators available. The rotator should be able to rotate HTML not just images (like the Glimmer tool, which can create JQuery/HTML code for rotating images).

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

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

发布评论

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

评论(5

稍尽春風 2024-09-19 00:52:18

为什么要使用插件?使用这一行(为了便于阅读,我只是将其分为 3 行)

请参阅 演示

你的 HTML应该是这样的

HTML

<div class="yourContainer">
 <div>some html</div>
 <div>other html</div>
</div>

JS / jQuery

$(function(){
    $('.yourContainer div:gt(0)').hide();
    setInterval(function(){$('.yourContainer :first-child').fadeOut().next().fadeIn().end().appendTo('.yourContainer');}, 3000);
});

CSS (可选=使过渡更平滑)

.yourContainer{ position:relative;}
.yourContainer div{ position:absolute; hight:300px; width:300px; background:red; }

Why use plug-in's? use this one liner (i just separated it into 3 lines for the sake of readability)

see demo

Your HTML should be something like this

HTML

<div class="yourContainer">
 <div>some html</div>
 <div>other html</div>
</div>

JS / jQuery

$(function(){
    $('.yourContainer div:gt(0)').hide();
    setInterval(function(){$('.yourContainer :first-child').fadeOut().next().fadeIn().end().appendTo('.yourContainer');}, 3000);
});

CSS (optional = makes transition smoother)

.yourContainer{ position:relative;}
.yourContainer div{ position:absolute; hight:300px; width:300px; background:red; }
可爱咩 2024-09-19 00:52:18

怎么样:

您甚至可以修改/自定义这些插件来创建您想要的效果。

How about:

You can even modify/customize these plugins to create the kind of effect you want.

贩梦商人 2024-09-19 00:52:18

链接文本非常酷。他们在演示中展示了来自 薪资公司 的示例,即使没有 Javascript,该示例也能很好地降级。

link text is pretty cool. They show an example from a payroll company in their demos that even degraded nicely without Javascript.

顾挽 2024-09-19 00:52:18

我创建了一个名为 Basic jQuery Slider 的简单插件。它简单、干净,并且只做它应该做的事情。如果您决定使用它并有任何疑问,请提出,我会帮助您。

I created a simple plugin called Basic jQuery Slider. It's simple and clean and just does what it's supposed to. If you decide to use it and have any questions, just ask and I'll help you out.

-残月青衣踏尘吟 2024-09-19 00:52:18

实际上我最终使用了 SlidesJS。 Zurb 的这个也很棒。

I actually ended up using the SlidesJS. This one by Zurb is also great.

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