jQuery 幻灯片插件:仅存在一张幻灯片时幻灯片图像不可见

发布于 2024-11-26 16:52:00 字数 1656 浏览 1 评论 0原文

我正在使用 Nathan Searles 非常好的幻灯片插件

我有一个包含幻灯片显示的多个动态实例的页面:http://hnoc。 dreamhosters.com/dev/property_info.php?lot=22644

当滑块中仅存在一张图像时,不会显示图像。上面链接中的第一个滑块显示了此问题。当存在多个图像时,它们都显示正常: http://hnoc.dreamhosters.com /dev/property_info.php?lot=22622

这是第一个链接处的单个图像的代码。

这是否敲响了警钟?我有错误吗?

任何建议非常感谢!

<div id="container1">
<div id="slides1">
<div class="slides_container">
<div class="slides_control">
<div class="slide" style="">
<a href="images/intermediate/I014N1013.jpg" rel="lightbox" title="Title: Plan of eight lots of ground with the buildings and improvements thereon...">
<img class="content" src="images/covers/C014N1013.jpg" alt="C014N1013.jpg"></a>
<div class="caption" style="bottom: 0px; ">Plan of eight lots of ground with the buildings and improvements thereon... </div>
</div> <!-- slide -->
</div> <!-- slides_control -->
</div> <!-- slides_container -->
<a href="#" class="prev"><img src="js/slides/img/arrow-prev.png" width="24" height="43" alt="Arrow Prev"></a>
<a href="#" class="next"><img src="js/slides/img/arrow-next.png" width="24" height="43" alt="Arrow Next"></a>   
</div> <!-- slides1 -->
<img src="js/slides/img/example-frame.png" width="739" height="341" alt="Frame" id="frame1">
</div>

I am working with Nathan Searles very nice Slides plugin.

I have a page with multiple dynamic instances of the slides display: http://hnoc.dreamhosters.com/dev/property_info.php?lot=22644

When only one image is present in the slider the image is not displayed. The first slider at the link above displays this issue. When multiple images are present they all display fine: http://hnoc.dreamhosters.com/dev/property_info.php?lot=22622

Here is the code for the single image at the first link.

Does this ring any bells? Do I have an error?

Any advice most appreciated!

<div id="container1">
<div id="slides1">
<div class="slides_container">
<div class="slides_control">
<div class="slide" style="">
<a href="images/intermediate/I014N1013.jpg" rel="lightbox" title="Title: Plan of eight lots of ground with the buildings and improvements thereon...">
<img class="content" src="images/covers/C014N1013.jpg" alt="C014N1013.jpg"></a>
<div class="caption" style="bottom: 0px; ">Plan of eight lots of ground with the buildings and improvements thereon... </div>
</div> <!-- slide -->
</div> <!-- slides_control -->
</div> <!-- slides_container -->
<a href="#" class="prev"><img src="js/slides/img/arrow-prev.png" width="24" height="43" alt="Arrow Prev"></a>
<a href="#" class="next"><img src="js/slides/img/arrow-next.png" width="24" height="43" alt="Arrow Next"></a>   
</div> <!-- slides1 -->
<img src="js/slides/img/example-frame.png" width="739" height="341" alt="Frame" id="frame1">
</div>

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

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

发布评论

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

评论(1

寄人书 2024-12-03 16:52:00

编辑slides.jquery.js

// after the variable setting on and after line 29
var elem = $(this),
control = $('.slides_control',elem),
total = control.children().size(),
... snip ...
playInterval;

add

if (total == 1){        
  $('.'+option.container,elem).css({display:'block'});          
  // disable prev/next imgs
  $('.'+option.prev+' img',elem).css({display:'none'});
  $('.'+option.next+' img',elem).css({display:'none'});
}

这解决了它。

和平。

Edit slides.jquery.js

// after the variable setting on and after line 29
var elem = $(this),
control = $('.slides_control',elem),
total = control.children().size(),
... snip ...
playInterval;

add

if (total == 1){        
  $('.'+option.container,elem).css({display:'block'});          
  // disable prev/next imgs
  $('.'+option.prev+' img',elem).css({display:'none'});
  $('.'+option.next+' img',elem).css({display:'none'});
}

That solves it.

Peace.

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