【发布时间】:2014-10-27 18:31:05
【问题描述】:
我正在建立一个网站,其中一个页面上有一个展示一些图片的部分。我认为 prettyPhoto 看起来不错,并决定使用它。
现在我在引导程序中有一个方形“盒子”,有 2 行 col-md-4 行(共 6 行)。每个图像都有一个悬停状态,在悬停时会发生变化,显示一个可供单击的图标,然后从那里打开 prettyPhoto。
鉴于文档,我不确定如何将多个图像添加到 prettyPhoto,但他们的文档中有一些示例,我只是没有运气实现它们。
这是我的代码
html
<div class="row centered">
<div class="col-md-4 portfolio-item web-design">
<div class="he-wrap tpl6">
<img src="images/portfolio-2/crate-of-california.jpg" height="450px" width="600px" class="img-responsive" alt="">
<div class="he-view">
<div class="bg a0" data-animate="fadeIn">
<h3 class="a1" data-animate="fadeInDown">Crate of California</h3>
<a data-rel="prettyPhoto[gallery1]" href="images/portfolio-2/crate-of-california.jpg" width="600" height="486" class="dmbutton a2" data-animate="fadeInUp"><i class="fa fa-search"></i></a>
</div><!-- he bg -->
</div><!-- he view -->
</div><!-- he wrap -->
</div>
js
(function($) {
// prettyPhoto
jQuery(document).ready(function(){
jQuery('a[data-gal]').each(function() {
jQuery(this).attr('rel', jQuery(this).data('gal'));
});
jQuery("a[data-rel^='prettyPhoto']").prettyPhoto({animationSpeed:'slow',theme:'light_square',slideshow:false,overlay_gallery: false,social_tools:false,deeplinking:false,allow_resize:true});
});
})(jQuery);
如果需要,我可以发布 css,但其中大部分与问题无关。
有谁知道我如何使用 prettyPhoto 在每张图片上显示多张图片(画廊)?任何帮助,将不胜感激。
【问题讨论】:
标签: javascript html twitter-bootstrap prettyphoto