javascript - Displaying multiple images in PrettyPhoto -
javascript - Displaying multiple images in PrettyPhoto -
i building website, , on 1 of pages section show off images. thought prettyphoto looked good, , decided utilize it.
right have square 'box' in bootstrap 2 col-md-4 rows (6 total). each image has hover state changes on hover, showing icon click on, , there prettyphoto opens.
i not sure how add together multiple images prettyphoto given documentation, there examples of on documentation, haven't had luck implementing them.
here code
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><!-- bg --> </div><!-- view --> </div><!-- 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);
i can post css if needed, of has nil problem.
does know how display multiple images (galleries) per image prettyphoto? help appreciated.
so able figured out, documentation on site not @ , took me couple hours figure out, gets utilize out of this.
basically, trying display image gallery each of 6 images in 2x3 rows. code ended being;
html
<div class="col-md-4 portfolio-item web-design"> <div class="he-wrap tpl6"> <img src="images/portfolio-2/kenneth-cole.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">kenneth cole</h3> <a rel="prettyphoto[gallery2]" href="images/portfolio-2/kenneth-cole.jpg" class="dmbutton a2" data-animate="fadeinup"><i class="fa fa-search"></i></a> <a href="images/portfolio-images/kennethcole2.png" class="lightbox-image lightbox-hide" rel="prettyphoto[gallery2]" title="another title 2"></a> <a href="images/portfolio-images/kennethcole3.png" class="lightbox-image lightbox-hide" rel="prettyphoto[gallery2]" title="another title 2"></a> <a href="images/portfolio-images/kennethcole4.png" class="lightbox-image lightbox-hide" rel="prettyphoto[gallery2]" title="another title 2"></a> </div><!-- bg --> </div><!-- view --> </div><!-- wrap --> </div> ..... <!-- beneath main content, before closing body tag social tools (twitter , facebook sharing) in there default, takes off --> <script type="text/javascript" charset="utf-8"> $(document).ready(function(){ $("a[rel^='prettyphoto']").prettyphoto({social_tools:''}); }); </script> </body>
basically have create sure you're 'trigger' rel=prettyphoto
, , can have multiple ones of each div. prettyphoto has helpers , buttons 1 time multiple images showing up.
javascript html twitter-bootstrap prettyphoto
Comments
Post a Comment