themyth92 / ngx-lightbox

Lightbox2 use with angular >= 5
MIT License
115 stars 67 forks source link

modal isn't opening #47

Open moshebengan opened 4 years ago

moshebengan commented 4 years ago

I'm loading the photos via http get request from server i've created i'm storing the json to new array of objects - every object have src, caption, thumb. (src and thumb - same photo) the gallery looks good - but when tapping on the thumbnail - modal isn't opened - page scroller is expanded.

i'm using angular cli 9.0.4, ngx-lightbox 2.1.2

maybe the bug caused because i'm setting the array of objects on ngOninit - not like the example - where the array of objects was set on the constructor?

files are attached

birdsGalleryFe.zip

themyth92 commented 4 years ago

maybe the bug caused because i'm setting the array of objects on ngOninit

I dont think that is the problem. Do you have any errors in your console ?. Do you call this._lightbox.open(this._albums, index); like in the example ?

moshebengan commented 4 years ago

no errors, and i call it exactly like the example

themyth92 commented 4 years ago

Then maybe it is a problem with CSS, maybe the css is conflicting with your current CSS. Check your DOM if these contents are added:

Screenshot 2020-03-09 at 4 56 00 PM

Also do you include lightbox.css ?

piotrzuzak commented 4 years ago

This should be definitely lack of css. I had the same issue today. Please add css to styles in angular.json as here: image

@themyth92 , this divs are visible at the bottom of tree dom so it should work for him.