UIkit lightbox Iframe plugin
(function () { | |
"use strict"; | |
UIkit.on('beforeready.uk.dom', function () { | |
UIkit.plugin("lightbox", "iframe", { | |
init: function (lightbox) { | |
lightbox.on("showitem.uk.lightbox", function (e, data) { | |
var resolve = function (source, width, height) { | |
data.meta = { | |
'content': '<iframe class="uk-responsive-width" src="' + source + '" width="' + width + '" height="' + height + '"></iframe>', | |
'width': width, | |
'height': height | |
}; | |
data.type = 'iframe'; | |
data.promise.resolve(); | |
}; | |
if (data.type === 'iframe' || data.source.match(/\.(html|php)$/)) { | |
resolve(data.source, (lightbox.options.width || 800), (lightbox.options.height || 600)); | |
} | |
}); | |
} | |
}); | |
}); | |
}()); |
This comment has been minimized.
This comment has been minimized.
Excellent! It works! |
This comment has been minimized.
This comment has been minimized.
It works! Thanks a lot! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
Make sure to add the
data-lightbox-type="iframe"
attribute to the lightbox!