Help with colorbox

edited July 2012 in News & Announcements

I know this is probably not a fuel problem but maybe you can help?

I have a sidemenu that calls pages with ajax.
The url is: mysite/members/submenuitem (This is actually a category name)

In the view that is being called I have a gallery that uses colorbox.
So the members.php file has this script in it:
jQuery(' li a').colorbox();

The html in the members.php file:
<ul class="gallery"> <?php $CI->load->model('member_images_model'); $images = $CI->member_images_model->find_all(array('member_id'=>$memberId), 'id asc'); foreach($images as $img): $image = img_path() . 'members/' .$img->image; echo '<li> <a href="' . $image .'" rel="' . $memberId . '"><img src="' . $image . '" height="100" /></a> </li>'; endforeach; ?> </ul>

The colorbox js file and css files are being loaded, I checked in the page source.

Yet I am getting this error:

jQuery(" li a").colorbox is not a function
[Break On This Error]

jQuery(' li a').colorbox();

Any ideas why?


  • edited 12:37PM
    Did you wrap it in a load function like so:
    jQuery(" li a").colorbox()
  • edited 12:37PM
    Ok, I removed the ajax call, and calling the sidemenu items like this:
    Now the colorbox is working.
Sign In or Register to comment.