jColorbox does not group images

I’m using Colorbox in form of Yii 1.x widget. Everything works fine, except for the fact, that Colorbox does not group my images and does not show <-- / --> buttons.

This is part of code generated by my page:


<div class="media-gallery-wrapper">

	<div class="media-gallery-item">

    	<a href="http://127.0.0.1/usrector/htdocs/uploads/galleries/15.jpg" class="colorbox cboxElement" title="">

        	<img src="http://127.0.0.1/usrector/htdocs/uploads/galleries/15small.jpg" alt="" width="450" height="450">

    	</a>

	</div>

</div>

Each three of such blocks are followed by:


<div class="media-gallery-separator"></div>

And that’s all. Even though I’ve been trying to modify my code and browsing through Colorbox examples, I don’t see any significant difference between my code and those on examples. Thus, I don’t know, what makes my Colorbox not grouping images?

you can try with ubergallery http://www.ubergallery.net/.

With a fews tweaks, I successfully implemented it in my Yii website.

Grouping in Colorbox works only, if you base it on rel attribute. You can’t use classes.

So, this:


<a href="<?php echo $filename; ?>" class="colorbox" title="<?php echo $title; ?>">


<script type="text/javascript">

	jQuery('.colorbox').colorbox({'maxHeight':'80%','maxWidth':'90%'});

</script>

won’t work (no image grouping, no <- / -> buttons), while this:


<a href="<?php echo $filename; ?>" rel="colorbox" title="<?php echo $title; ?>">


<script type="text/javascript">

	jQuery('a[rel="colorbox"]').colorbox({'maxHeight':'80%','maxWidth':'90%'});

</script>

will work like a charm.