lokesh / lightbox2

THE original Lightbox script (v2).
http://lokeshdhakar.com/projects/lightbox2/
MIT License
6.14k stars 1.77k forks source link

Lightbox loader shows up in bottom center of screen #97

Closed clouddueling closed 10 years ago

clouddueling commented 10 years ago

When the height of my window is large enough this appears:

screen shot 2013-09-05 at 3 15 08 pm

When I change left to: -10000px then it disappears. I don't know the codebase well enough to know if it causes other problems but appears to work. screen shot 2013-09-05 at 3 24 14 pm

hothandao commented 10 years ago

Yeah, this issue happen to me as well: Please see demo here http://diaocx.com/duan_s/du-an-chung-cu-euroland-tsq-chung-cu-lang-viet-kieu-chau-au.html

mergjo commented 10 years ago

i have the same issue if the page is very long, the lightbox opens on bottom of the sreen I can´t change it.

image

please see the test-page here: http://www.the-flying-stars.de/galerie4-2.htm ... in the 6. galery

clouddueling commented 10 years ago

@mergjo @hothandao Have you tried my left position fix? Did it work for you as well?

mergjo commented 10 years ago

Hello clouddueling. I don´t know, hwat you mean. Sorry, I´m only a "user", not a progammer.

left is "0" (zero)

...

/* line 20, ../sass/lightbox.sass */ .lightbox { position: absolute; left: 0; width: 100%; z-index: 10000; text-align: center; line-height: 0; font-weight: normal;

...

mergjo commented 10 years ago

on a short page the lightbox.css works fine. see: http://www.the-flying-stars.de/galerie4-1.htm

but not on a very long page.

whitch parametre is impotant for the "high position"?

clouddueling commented 10 years ago

@mergjo Would you mind changing left in the css to -10000px and see if this problem persists for you?

mergjo commented 10 years ago

left: -10000px;

the same problem, as before

danglering commented 10 years ago

I had the same problem as mergjo. I tried to change the css, as described above, but it did not help me. Then I look into the js file lightbox-2.6.min.js i'm not a javacript programmer, i just search word "top:", because it is responsible for the location in html: div id="lightbox" class="lightbox" style="display: block; top: 4298.05px; left: 0px;"

i find this word in lightbox-2.6.min.js on line: f=b(window);o=f.scrollTop()+f.height()/10;n=f.scrollLeft();this.$lightbox.css({top:o+'px',left:n+'px'})

i.e. top:o+'px' and o=f.scrollTop()+f.height()/10

to decrease variable 'o' i changed 10 to 100: o=f.scrollTop()+f.height()/100

and it works! now my pics open at right height, even if the height of the page is over 9000 px

mergjo commented 10 years ago

Hello danglering, it´s great!! Thanks for this idea.

I also changed 10 to 100 and it works fine!

danglering commented 10 years ago

mergjo, you are welcome! I just struggled with this problem for over a month, so I decided to tell the others about my solution )

jenfield commented 10 years ago

Thank you danglering. I changed mine to: o=f.scrollTop()+10 which then does not based the position on the height of you page at all... it just put's it 10px down on the page.

claireannice commented 10 years ago

I tried the css left change, and the js change, to both +10 and /100. None of these have worked for me.

So frustrating.

lokesh commented 10 years ago

Doing some Github Issues cleanup.

I'm unable to recreate this issue. If this problem still exists for anyone please post a link and I will reopen this issue and investigate. Thanks.

phbernard commented 8 years ago

I could observe this issue with LB 2.8.2, by calling lightbox.init() twice. First time, everything works as expected. Second time, the loader is shown as described by @clouddueling.

Fixes: