colorbox
colorbox copied to clipboard
AMD support
Hi, Jack! First of all - great plugin, thanks a lot for the one! I know about 3 years ago there was an issue about AMD compatible (#427), but i dont understand is it planing for now or not? Thanks!
+1 from me. jquery loaded via AMD so theres no global jquery, and colorbox doesnt register.
Probably need a pullrequest. For the time being will have to add a UMD loader and load it locally.
Workaround is use (requirejs) config.shim to bring colorbox into 2018:
require.config = {
"shim": {
"colorbox": {
"deps": ["jquery"],
exports: "jQuery.fn.colorbox"
}
}
then you can write code:
require(['jquery','colorbox'], function($,colorbox) {
$("#gallery").colorbox();
});