自定义 jQuery Gallery 缩略图行为
最近,我从 SLAks(谢谢)那里得到了一些关于我的自定义画廊行为的帮助。我现在正在尝试修复缩略图的工作方式。我已经摆弄它大约一个小时了,但我无法让它工作。代码的实时版本: http://www.studioimbrue.com 。目前的代码如下:
$('.thumbscontainer ul li a').click(function() {
var li_index = $(this).parents('ul').children('li').index($(this).parent("li"));
$(this).parents('.thumbscontainer').parent().find('.captions ul li').fadeOut();
$(this).parents('.thumbscontainer').parent().find('.captions ul li:eq('+li_index+')').fadeIn();
});
$('.container .captions li').click(function() {
var nextLi = $(this).fadeOut().next().fadeIn();
if (nextLi.length === 0) //If we're the last one,
nextLi = $(this).siblings(':first-child').fadeIn();
});
唯一的问题是,当单击图库图像时,它会转到该系列中的下一张图像,但缩略图不会更改为列表中的下一张。你可以看看我之前的问题,看看我们的讨论。谢谢
I recently got some help on here from SLaks (thank you) on the behavior of my custom gallery. I'm now trying to fix the way the thumbnails function. I've been toying with it for about an hour but I can't get it to work. Live version of the code: http://www.studioimbrue.com . Currently the code is as follows:
$('.thumbscontainer ul li a').click(function() {
var li_index = $(this).parents('ul').children('li').index($(this).parent("li"));
$(this).parents('.thumbscontainer').parent().find('.captions ul li').fadeOut();
$(this).parents('.thumbscontainer').parent().find('.captions ul li:eq('+li_index+')').fadeIn();
});
$('.container .captions li').click(function() {
var nextLi = $(this).fadeOut().next().fadeIn();
if (nextLi.length === 0) //If we're the last one,
nextLi = $(this).siblings(':first-child').fadeIn();
});
The only problem is that when the gallery image is clicked, it goes to the next image in the series, yet the thumbnails do not change to the next one in the list. You can take a look at my previous question to see our discussion. Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
像这样:
这必须与以下内容位于同一块中
Like this:
This must be in the same block as