Does anyone know how to align pretty photo so it opens centred on a page with a horizontal scrollbar?
From what I can see there is a function _center_overlay() on line 616 which should be doing it. It is returning the correct Xoffset value but it does not center the lightbox when it opens.
I’m using prettyPhoto 3.0.1.
I have been poking at it for a while and managed to get it working in Chrome but the fix didn’t work with Firefox 3.6 or IE 7 / 8.
So as an example: http://danieldau.com/prettyphoto/
Looking at that link, what would you like to achieve ?
If you scroll along the page to “MC and UPB ” and then click one of lightbox links the lightbox opens but it is not centred on the area of the page you have scrolled to. If you then scroll the page to the right or left the lightbox window position is updated and it is then centred.
Ahh gottya
try these fixes: http://forums.no-margin-for-errors.com/discussion/437
I came across that solution before and it does fix the horizontal scrolling problem but it creates problems with vertical scrolling instead. Maybe I’ll just use different css files for different layouts.
EugeneO said
I came across that solution before and it does fix the horizontal scrolling problem but it creates problems with vertical scrolling instead.
Have you thought of using colorbox ?
Or similar. Without seeing your site link, its a case of stabbing in the dark. We use a vertical auto scroll using “scrollto” but never used modal window popups with it.
My guess is if each frame ( div ) is formatted correctly, then the issue seems to be to set auto centering of the modal relative to that slide.
Not an easy option I suppose, but you can force modals to center.
Look at Evolution ( search for it on codecanyon )
We use that, and no matter how we try , it always centers. Perhaps theres a trick or two in that you can utilise
I wanted to stick with prettyPhoto because I know it is very easy to integrate with WordPress with no fuss but I might look at some other lightboxes to see what alternatives there are. For now the extra stylesheet, or even inline styling, on the horizontal layouts are probably the simplest solution.
Thanks a lot for you help SportTipsWorld. I’ll continue to look into it and see what I can do.
EugeneO said
I wanted to stick with prettyPhoto because I know it is very easy to integrate with WordPress with no fuss but I might look at some other lightboxes to see what alternatives there are. For now the extra stylesheet, or even inline styling, on the horizontal layouts are probably the simplest solution. Thanks a lot for you help SportTipsWorld. I’ll continue to look into it and see what I can do.
More often than not, its js or css causing the issue.
Many people have similar issue, its a case of thrashing it out reverse coding.
http://stackoverflow.com/questions/2632746/horizontally-and-vertically-center-modal-div-ie-issue
