简体   繁体   中英

jQuery Colorbox for WP doesn't group images

I am using jQuery Colorbox Plugin for my website and I wanted to group some pictures with it. My code is as follows:

<div class="gal">
    <a class="group cboxElement" href="[img]"><img src="[img]" class="postImg colorbox-manual"></a>
    <a class="group cboxElement" style="display: none" href="[img]"><img src="[img]" class="postImg colorbox-manual"></a>
    <a class="group cboxElement" style="display: none" href="[img]"><img src="[img]" class="postImg colorbox-manual"></a>
    <a class="group cboxElement" style="display: none" href="[img]"><img src="[img]" class="postImg colorbox-manual"></a>
</div>

First image is meant to be visible while the rest should remain hidden. My problem is, when I click on the first link, there is no group, no other images to go to.

What can I do?

Here's how I launch it:

$('.group1').colorbox({
  opacity:0.9,
  maxWidth:'95%',
  maxHeight:'100%',
  rel:'group1'});

Hope it helps!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM