Question about lightbox

How do you populate the lightbox using Ajax? Does the element have to have data attributes or can you define it in the JS script? Or can it do both?

  • Another question, how do I load the lightbox using jQuery? Documentations doesn't show how to use it via a trigger.

  • Ah nvm, calling it directly using the $.colorbox() function works.

    $('#trigger').colorbox({
        title: '123', 
        href: elgg.normalize_url('ajax/view/my_plugin/name_of_view')
    });