I'm using Lightbox 2.51 and I can't find a solution to move lb-dataContainer with close button and current image number etc to the top

I only found solutions for the old versions.
Code can be found here: http://lokeshdhakar.com/projects/lightbox2/releases/lightbox2.51.zip
The solution is to change outer container with data container:
Lightbox.prototype.build = function() {
var $lightbox,
_this = this;
$("<div>", {id: 'lightboxOverlay'}).after
(
$('<div/>', {id: 'lightbox'}
).append(
$('<div/>', {
"class": 'lb-dataContainer'
}).append($('<div/>', {
"class": 'lb-data'
}).append($('<div/>', {
"class": 'lb-details'
}).append($('<span/>', {
"class": 'lb-caption'
}), $('<span/>', {
"class": 'lb-number'
})), $('<div/>', {
"class": 'lb-closeContainer'
}).append($('<a/>', {
"class": 'lb-close'
}).append($('<img/>', {
src: this.options.fileCloseImage
})))
)),
$('<div/>', {"class": 'lb-outerContainer'}).append
( $('<div/>', {
"class": 'lb-container'
}).append($('<img/>', {
"class": 'lb-image'
}), $('<div/>', {
"class": 'lb-nav'
}).append($('<a/>', {
"class": 'lb-prev'
}), $('<a/>', {
"class": 'lb-next'
})), $('<div/>', {
"class": 'lb-loader'
}).append($('<a/>', {
"class": 'lb-cancel'
}).append($('<img/>', {
src: this.options.fileLoadingImage
}))))
)
)
).appendTo($('body'));
$('#lightboxOverlay').hide().on('click', function(e) {
_this.end();
return false;
});
This is YEARS later, but if you want the easiest way to do this by far, simply use the following 4 lines of CSS:
#lightbox {
display: flex;
flex-direction: column-reverse;
}
The flexbox will flip the display order on the container to be in reverse from the DOM.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With