The usual way to assign color box functionality on a link is like this:
$("a.colorbox").colorbox({ transition: "elastic" });
Newly added items are not bound in this way though.
How can I add colorbox to dynamically created
<a class="colorbox"></a>
elements too?
The method described here is to live-bind to the
clickevent on the elements you’re interested in (such as.colorboxin this instance) and call the colorbox library function in the handler: