javascript Nivo Slider 在 Chrome 和 Safari 中出现问题

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4824140/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 14:59:35  来源:igfitidea点击:

Nivo Slider having problem in Chrome & Safari

javascriptjquerycssplugins

提问by wasimbhalli

I'm using Nivo slider on this page. The problem is that the slider collapses in chrome and safari. What I need to change?

我在此页面上使用 Nivo 滑块。问题是滑块在 chrome 和 safari 中折叠。我需要改变什么?

Secondly, I want to change the title and links on each new images. How will I accomplish this? Will I use "afterChange" method? I've to load images dynamically using some server-side language (PHP). Please help!

其次,我想更改每个新图像的标题和链接。我将如何做到这一点?我会使用“afterChange”方法吗?我必须使用某种服务器端语言 (PHP) 动态加载图像。请帮忙!

回答by methodofaction

#nivo-slider is supposed to have a height and width specified, you're applying dimentions to its parent container, #nivo-slider-wrapper.

#nivo-slider 应该有一个指定的高度和宽度,你正在将维度应用到它的父容器,#nivo-slider-wrapper。

If you have more than one question the best practice is to post them separatedly.

如果您有多个问题,最佳做法是将它们分开发布。

回答by Matt Carr

Hey. I can't help with the afterChange method, but I can help with the collapsing issues you are having.

嘿。我无法帮助 afterChange 方法,但我可以帮助解决您遇到的崩溃问题。

Try putting the following in your styles.css:

尝试将以下内容放入你的style.css

#slider {
     min-height: 400px; //or whatever height you require.
}

And then alter your html for displaying the nivoSlider to:

然后将用于显示 nivoSlider 的 html 更改为:

<div id="slider" class="nivoSlider">
     //other nivo stuff here.
</div>

Should solve the collapsing problem. Good luck :)

应该解决崩溃的问题。祝你好运 :)