fix(lightbox): improve compatibility and responsiveness

Updated lightbox initialization to use jQuery namespace for better compatibility. Tweaked CSS to use viewport units for enhanced responsiveness. These changes aim to prevent potential conflicts and adapt lightbox content better to different screen sizes.
This commit is contained in:
Kumi 2024-08-06 20:26:13 +02:00
parent 60b731c1c6
commit 4de71503e8
Signed by: kumi
GPG key ID: ECBCC9082395383F
2 changed files with 5 additions and 4 deletions

View file

@ -1,5 +1,6 @@
$(document).ready(function() {
$('div.wp-caption a:first').click(function(event) {
jQuery(document).ready(function() {
const $ = jQuery;
$('div.wp-caption a:first-child').click(function(event) {
event.preventDefault();
var imgSrc = $(this).attr('href');
$('#lightbox-img').attr('src', imgSrc);

View file

@ -181,8 +181,8 @@ a h5 {
.lightbox-content {
margin: auto;
display: block;
width: 80%;
max-width: 700px;
max-width: 80vw;
max-height: 90vh;
}
.lightbox-close {