fixed 修复图片灯箱bug
This commit is contained in:
1 parent
84dd45db85
commit
0518c9c92c
2 files changed
+35
-2
No files matched your search
@@ -1694,7 +1694,7 @@ ul {
|
||||
color: #111827;
|
||||
text-decoration: none;
|
||||
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
|
||||
z-index: 2147483647; /* Ensure it's on top */
|
||||
z-index: 900; /* Ensure it's on top */
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@@ -3460,7 +3460,7 @@ input[type=submit] {
|
||||
position: fixed;
|
||||
bottom: 30px;
|
||||
right: 15px;
|
||||
z-index: 2147483647;
|
||||
z-index: 900; /* Lowered from max-int to be below modals and lightbox */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
@@ -3471,6 +3471,19 @@ input[type=submit] {
|
||||
/* Ensure visibility stability */
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
|
||||
}
|
||||
|
||||
.floating-tools.hidden {
|
||||
opacity: 0 !important;
|
||||
visibility: hidden !important;
|
||||
transform: translateZ(0) translateY(20px) !important;
|
||||
pointer-events: none !important;
|
||||
}
|
||||
|
||||
/* Override ViewImage z-index to ensure it is above floating tools */
|
||||
.view-image {
|
||||
z-index: 2000 !important;
|
||||
}
|
||||
|
||||
.floating-tools a {
|
||||
|
||||
@@ -190,6 +190,26 @@ window.initFloatingTools = function() {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 4. Lightbox Observer (ViewImage)
|
||||
// Hide floating tools when lightbox is open
|
||||
if (window.lightboxObserver) {
|
||||
window.lightboxObserver.disconnect();
|
||||
}
|
||||
|
||||
if (container) {
|
||||
window.lightboxObserver = new MutationObserver(function(mutations) {
|
||||
var lightbox = document.querySelector('.view-image');
|
||||
if (lightbox) {
|
||||
container.classList.add('hidden');
|
||||
} else {
|
||||
container.classList.remove('hidden');
|
||||
}
|
||||
});
|
||||
|
||||
window.lightboxObserver.observe(document.body, { childList: true });
|
||||
}
|
||||
|
||||
} catch (e) {
|
||||
console.error('Error in initFloatingTools:', e);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user