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:
parent
60b731c1c6
commit
4de71503e8
2 changed files with 5 additions and 4 deletions
|
@ -1,5 +1,6 @@
|
||||||
$(document).ready(function() {
|
jQuery(document).ready(function() {
|
||||||
$('div.wp-caption a:first').click(function(event) {
|
const $ = jQuery;
|
||||||
|
$('div.wp-caption a:first-child').click(function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
var imgSrc = $(this).attr('href');
|
var imgSrc = $(this).attr('href');
|
||||||
$('#lightbox-img').attr('src', imgSrc);
|
$('#lightbox-img').attr('src', imgSrc);
|
||||||
|
|
|
@ -181,8 +181,8 @@ a h5 {
|
||||||
.lightbox-content {
|
.lightbox-content {
|
||||||
margin: auto;
|
margin: auto;
|
||||||
display: block;
|
display: block;
|
||||||
width: 80%;
|
max-width: 80vw;
|
||||||
max-width: 700px;
|
max-height: 90vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lightbox-close {
|
.lightbox-close {
|
||||||
|
|
Loading…
Reference in a new issue