Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var src = 'randomimage.jpg';
- basicLightbox
- .create( '<div class="basicLightboxLoader">Loading ...</div>', {
- afterShow: function( instance ) {
- var $element = $( instance.element() ),
- target = $element.find('.basicLightbox__placeholder'),
- image = new Image();
- image.onload = function () {
- target
- .html( image );
- $element.addClass('basicLightbox--img');
- };
- image.onerror = function() {
- instance.close();
- }
- image.src = src;
- }
- }).show();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement