Nivo 滑块拇指

发布于 2024-10-28 03:24:00 字数 402 浏览 2 评论 0 原文

我正在使用 nivo-slider,我正在尝试制作缩略图,但我无法让它工作。

这是我所拥有的:

Nino Slider 演示

这是有关如何操作的教程,但我无法让它工作。

Nive Slider Website

我希望有人能看到我做错了什么

I'm using the nivo-slider and im trying to make thumbnails but I cant get it to work.

Here is what I have:

Nino Slider Demo

Here is the tutorial on how to, but i cant get it to work.

Nive Slider Website

I hope some one can see what i do wrong

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

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

发布评论

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

评论(4

<逆流佳人身旁 2024-11-04 03:24:00

我发现主题“default.css”与 img 样式冲突(如教程中所述)。您需要注释掉 default.css 中以下类的 css 样式:

.theme-default .nivoSlider img
.theme-default .nivoSlider a
.theme-default .nivo-controlNav
.theme-default .nivo-controlNav a
.theme-default .nivo-controlNav a.active

并且,如其 教程,你需要添加这个样式:

#slider .nivo-controlNav {
    position:absolute;
    bottom:-70px; /* Put the nav below the slider */
}
#slider .nivo-controlNav img {
    display:inline; /* Unhide the thumbnails */
    position:relative;
    margin-right:10px;
}

我也遇到了这个问题,希望它对某人有帮助。

I have found that the theme 'default.css' conflicts with the img styling (as noted in their tutorial). You need to comment out the css styles in default.css for the following classes:

.theme-default .nivoSlider img
.theme-default .nivoSlider a
.theme-default .nivo-controlNav
.theme-default .nivo-controlNav a
.theme-default .nivo-controlNav a.active

And, as noted in their tutorial, you need to add this styling:

#slider .nivo-controlNav {
    position:absolute;
    bottom:-70px; /* Put the nav below the slider */
}
#slider .nivo-controlNav img {
    display:inline; /* Unhide the thumbnails */
    position:relative;
    margin-right:10px;
}

I had trouble too with this, hope it helps someone.

赴月观长安 2024-11-04 03:24:00

我也很难找到缩略图的位置。我终于通过将它们定位为“绝对”找到了它们,它们最终出现在幻灯片的中间:)

但我不太喜欢它们的显示方式,所以我做了一个快速修复,需要编辑脚本少量。

在 jquery.nivo.slider.js 中,在文件开头添加:

var thumbnails = $("#thumbnails"); // this is where your thumbnails will be

然后找到这个:

//Add Control nav
if(settings.controlNav){
    var nivoControl = $('<div class="nivo-controlNav"></div>');
    slider.append(nivoControl);

并替换为

//Add Control nav
if(settings.controlNav){
    var nivoControl = $('<div class="nivo-controlNav"></div>');
    thumbnails.append(nivoControl);

查找这个:

$('.nivo-controlNav a', slider).live('click', function(){

替换为:

$('.nivo-controlNav a', thumbnails).live('click', function(){

然后在页面中放置一个,就完成了:)

当然,很多可以进行一些改进,但正如我所说,这是一个快速解决方案。如果 Nivo 滑块的下一版本能够选择将缩略图放置在不同的位置,那就太好了。

希望这有帮助;)

I had lots of troubles finding where my thumbnails are as well. I finally found them by positionning them "absolute", and they finally appeared in the middle of the slideshow :)

But I don't really like the way they're displayed, so I made a quick fix which requires to edit the script a bit.

In jquery.nivo.slider.js, add this at the beginning of the file:

var thumbnails = $("#thumbnails"); // this is where your thumbnails will be

Then find this:

//Add Control nav
if(settings.controlNav){
    var nivoControl = $('<div class="nivo-controlNav"></div>');
    slider.append(nivoControl);

And replace with

//Add Control nav
if(settings.controlNav){
    var nivoControl = $('<div class="nivo-controlNav"></div>');
    thumbnails.append(nivoControl);

Find this:

$('.nivo-controlNav a', slider).live('click', function(){

Replace with:

$('.nivo-controlNav a', thumbnails).live('click', function(){

Then place a somewhre in your page, and you're done :)

Of course, lots of improvements can be done, but as I said it's a quick fix. That would be nice if next versions of Nivo slider had an option to place the thumbnails in a different location.

Hope this helped ;)

秋日私语 2024-11-04 03:24:00

Nivo 网站有一个新的演示,展示了缩略图的工作原理:http://nivo.dev7studios.com/demos/

相关示例具有以下 CSS 样式:

#slider3 {
    margin-bottom:110px;
}
#slider3 .nivo-controlNav {
    position:absolute;
    left:185px;
    bottom:-70px;
}
#slider3 .nivo-controlNav a {
    display:inline;
}
#slider3 .nivo-controlNav img {
    display:inline;
    position:relative;
    margin-right:10px;
    -moz-box-shadow:0px 0px 5px #333;
    -webkit-box-shadow:0px 0px 5px #333;
    box-shadow:0px 0px 5px #333;
}
#slider3 .nivo-controlNav a.active img {
    border:1px solid #000;
}

请注意 .nivo-controlNav 类中的 aimg 标记的方式使用 display: inline,这是使其工作的关键。

其他属性用于定位导航栏和添加阴影。

The Nivo site has a new demo that shows how the thumbnails work: http://nivo.dev7studios.com/demos/

The relevant example has the following CSS styling:

#slider3 {
    margin-bottom:110px;
}
#slider3 .nivo-controlNav {
    position:absolute;
    left:185px;
    bottom:-70px;
}
#slider3 .nivo-controlNav a {
    display:inline;
}
#slider3 .nivo-controlNav img {
    display:inline;
    position:relative;
    margin-right:10px;
    -moz-box-shadow:0px 0px 5px #333;
    -webkit-box-shadow:0px 0px 5px #333;
    box-shadow:0px 0px 5px #333;
}
#slider3 .nivo-controlNav a.active img {
    border:1px solid #000;
}

Note how both the a and the img tag in the .nivo-controlNav class use display: inline, that is key to making it work.

The other properties are for positioning the nav bar and adding drop shadows.

强者自强 2024-11-04 03:24:00

我自己在让图像缩略图正常工作方面遇到了很大的困难。这对我有用。完整详细信息请访问我的博客文章

将此 CSS 样式添加为最后加载(将其包含在其他核心 Nivo CSS 表下方的链接中),

.nivo-controlNav a {
display:inline; /* Display the thumbnail link element */
}

#slider .nivo-controlNav img {
display:inline; /* Un-hide the thumbnail image element */
position:relative;
margin: 10px 10px 0 0; /* Provide some white space around the thumbs */
}

#slider .nivo-controlNav {
position: absolute;
top: 600px; /* 600px is the height of our images in the slider */
}

并且在调用 Nivo 时不要忘记设置这些参数:

$('#slider').nivoSlider({
controlNav:true, /* Display the control navigation */
controlNavThumbs:true, /* Display thumbnails */
controlNavThumbsFromRel:true, /* Source thumbnails from rel attribute */
});

I had a great deal of difficulty getting image thumbnails to work properly myself. This worked for me. Full details at my blog entry.

Add this CSS styling as the last to load (include it in a LINK beneath the other core Nivo CSS sheets)

.nivo-controlNav a {
display:inline; /* Display the thumbnail link element */
}

#slider .nivo-controlNav img {
display:inline; /* Un-hide the thumbnail image element */
position:relative;
margin: 10px 10px 0 0; /* Provide some white space around the thumbs */
}

#slider .nivo-controlNav {
position: absolute;
top: 600px; /* 600px is the height of our images in the slider */
}

And don't forget to set these parameters when you call Nivo:

$('#slider').nivoSlider({
controlNav:true, /* Display the control navigation */
controlNavThumbs:true, /* Display thumbnails */
controlNavThumbsFromRel:true, /* Source thumbnails from rel attribute */
});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文