<script type="text/javascript">
// <![CDATA[
jQuery(document).ready(function($) {
//gets all "a" elements that have a nested "img"
$("a:has(img)").each(function(index, obj) {
//in this context, the first child is always an image if fundamental Wordpress functions are used
var $nestedElement = $(obj).children(0);
if ($nestedElement.is("img")) {
var $groupId = $nestedElement.attr("class").match('colorbox-[0-9]+');
//only call colorbox if there is a groupId for the image.
if ($groupId && !$nestedElement.attr("class").match('colorbox-off')) {
//and calls colorbox function on each img.
//elements with the same groupId in the class attribute are grouped
//the title of the img is used as the title for the colorbox.
$(obj).colorbox({rel:$groupId.toString(), <?php echo('maxWidth:' . '"' . $this->colorboxSettings['maxWidth'] . '"' . ',');
echo('maxHeight:' . '"' . $this->colorboxSettings['maxHeight'] . '"' . ',');
echo('height:' . '"' . $this->colorboxSettings['height'] . '"' . ',');
echo('width:' . '"' . $this->colorboxSettings['width'] . '"' . ',') ?> title:$nestedElement.attr("title")});
}
}
});
});
// ]]>
</script>
собственно что есть $(obj).colorbox
как мне извне добраться до значения rel ?
спасибо