nivo滑块问题

发布于 2024-12-25 03:36:25 字数 94 浏览 5 评论 0原文

我在我的网页中使用了 nivo-slider。我需要在我的单页中实现许多nivo-slider。我已经成功实施了。但是,如果我单击上一个图标,总滑块图像就会更改。请帮我。谢谢

I used nivo-slider in my web page. I need to implement many nivo-slider in my single page. I have successfully implement it. But, if i click the previous icon total slider images were changed. Please help me. Thanks

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

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

发布评论

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

评论(1

垂暮老矣 2025-01-01 03:36:25

其原因可能是相同的 id 使用。不同的滑块应该有不同的 id。

更改 id 名称后,您还需要调整 javascript 中的 nivo 函数以适应新的 id

例如,如果这是您的代码,

<script type="text/javascript">
    jQuery(window).load(function () {
        jQuery("#slider").nivoSlider()
    });
</Script>

对于具有 id 的三个滑块来说应该是这样的:slider-1、slider-2、滑块3

<script type="text/javascript">
    jQuery(window).load(function () {
        jQuery("#slider-1").nivoSlider()
        jQuery("#slider-2").nivoSlider()
        jQuery("#slider-3").nivoSlider() 
    });
</Script>

The reason for this is probably the same id usage. You should have different id's for different sliders.

After you change the id names, you will also need to make adjustments to your nivo function in javascript to accommodate new ids

For example if this is your code

<script type="text/javascript">
    jQuery(window).load(function () {
        jQuery("#slider").nivoSlider()
    });
</Script>

It should be like this for three sliders with ids : slider-1, slider-2, slider-3

<script type="text/javascript">
    jQuery(window).load(function () {
        jQuery("#slider-1").nivoSlider()
        jQuery("#slider-2").nivoSlider()
        jQuery("#slider-3").nivoSlider() 
    });
</Script>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文