Closed kentforth closed 3 years ago
It seems that position: fixed
is not working.
Can you provide a repo that can reproduce this issue?
Do you mean repository of my project that uses the library?
I guess the problem might be that if vue-easy-lightbox
's root elements has an ancestor with a transform
, perspective
or filter
property set to something other than none
, vue-easy-lightbox
will be positioned fixed relative to that ancestor element.
You can try putting vue-easy-lightbox
under an element that doesn't have the above css style.
https://developer.mozilla.org/en-US/docs/Web/CSS/position
position: fixed The element is removed from the normal document flow, and no space is created for the element in the page layout. It is positioned relative to the initial containing block established by the viewport, except when one of its ancestors has a transform, perspective, or filter property set to something other than none (see the CSS Transforms Spec), in which case that ancestor behaves as the containing block. (Note that there are browser inconsistencies with perspective and filter contributing to containing block formation.) Its final position is determined by the values of top, right, bottom, and left. This value always creates a new stacking context. In printed documents, the element is placed in the same position on every page.
@XiongAmao The problem was that parent div had transform property. I placed easy-lightbox in another div and the probllem is gone. Thank you!
I have many images in block When I click one of images, an image doesn't shows in center of screen I need an image to be sxactly in center of screen vertically even If I scroll page to bottom and clikc on last image. How to show images in center of screen? Is there something that I can change with CSS?
Video