我有这个 html,在图像周围的链接上设置了 data-fancybox-group 属性,就像在演示中一样,可以启用下一个/上一个,但它不起作用。我包括按钮 js 和 css 并且它们正确加载,所以我不知道为什么它不起作用。任何人都可以帮忙吗?
<ul class="gallery photos">
<li>
<div>
<h4><a href="http://nduna.demo.provokateur.com/media-center/photos/amy-robbins/">Amy Robbins</a></h4>
<div class="photocontent">
<p>
<a href="http://nduna.demo.provokateur.com/wp-content/uploads/2012/12/Homepage-Together1.jpg">
<img class="alignnone size-thumbnail wp-image-1082" title="Homepage-Together" src="http://nduna.demo.provokateur.com/wp-content/uploads/2012/12/Homepage-Together1-200x88.jpg" alt="" width="200" height="88" />
</a>
</p>
</div>
<a href="http://nduna.demo.provokateur.com/media-center/photos/amy-robbins/" class="cta">Show image</a>
</div>
</li>
<li>
<div>
<h4><a href="http://nduna.demo.provokateur.com/media-center/photos/unicef-hq07-0149indrias-getachew/">Indrias Getachew</a></h4>
<div class="photocontent">
<p>
<a href="http://nduna.demo.provokateur.com/wp-content/uploads/2012/07/070149F.jpg">
<img class="alignnone size-thumbnail wp-image-942" title="070149F" src="http://nduna.demo.provokateur.com/wp-content/uploads/2012/07/070149F-200x88.jpg" alt="" width="200" height="88" />
</a>
</p>
</div>
<a href="http://nduna.demo.provokateur.com/media-center/photos/unicef-hq07-0149indrias-getachew/" class="cta">Show image</a>
</div>
</li>
<li>
<div>
<h4><a href="http://nduna.demo.provokateur.com/media-center/photos/dsc-0103/">DSC 0103</a></h4>
<div class="photocontent">
<p>
<a href="http://nduna.demo.provokateur.com/wp-content/uploads/2012/07/DSC_0103.jpg">
<img class="alignnone size-thumbnail wp-image-943" title="DSC_0103" src="http://nduna.demo.provokateur.com/wp-content/uploads/2012/07/DSC_0103-200x88.jpg" alt="" width="200" height="88" />
</a>
</p>
</div>
<a href="http://nduna.demo.provokateur.com/media-center/photos/dsc-0103/" class="cta">Show image</a>
</div>
</li>
</ul>
除此以外,该脚本运行良好,这是js:
$('.homepnl.photo li, .gallery.photos li, .lb-photos').each(function(i,itm){
var photolink = $('.photocontent a',$(itm)).attr('href');
// var title = $('.wp-caption-text',$(itm)).text();
$('a',$(itm)).click(function(evt){
evt.preventDefault();
});
// $(itm).attr('title',title);
$(itm).attr('href',photolink);
$('.photocontent p a').attr(data-fancybox-group','gallery');
//applying the fancybook plugin to the item.
$(itm).fancybox({href:photolink, 'autoDimensions': true });
});
截止日期是昨天,因此非常感谢您的帮助!
该页面在这里: http: //nduna.demo.provokateur.com/media-center/