Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo
There seems to be a problem with correct sizing of the Lightbox when running within an Iframe. Basically, it seems to be looking at the dimensions of the Iframe, rather than the browser window.
The effect is that a small image positions halfway down the page, out of sight, and with a large image it overfills the browser window so the full image cannot be seen. It centers/sizes correctly when running outside an Iframe.
I have Lightbox running fine on oher parts of my Joomla site so, I'm guessing it mght be the way Lightbox is called from within PGV?
Yes, that has always been an issue with LB. If you check in the Bug Tracker list there might even be a very old report on it, can't remember for sure. If not, you should raise one, although I'm not sure how easy it might be to fix. Any ideas?
As Kiwi says, he had the same problems with Joomla iFrames about 18 months ago and I never found out why at the time.
The PGV Lightbox code is really a heavily modified version of "Clearbox" with sound, zoom, and PGV Note features included so I am not surprised that you say "Lightbox" works in Joomla as we are probably not talking about the same program (Lightbox comes in about 10 different versions at the last count)
However, as Kiwi eventually dropped Joomla, I went onto other things, and did not have the time at that moment to research why it is not good with Joomlah iFrames.
Most other Lightboxes set the "Lightbox" with respect to the top of the page. Clearbox calculates the size of the browser window, and then resizes and sets the image in the center, with a border of about 20px from the closest extremeities (or something like that .. it's ages since I was in the code.)
Unfortunately I am again bang in the middle of developing some new functions for PGV (hopefully for the next release) so again really do not have time to relearn what I did 2 years ago and tackle this problem for Joomla.
The function CB_SetAllPositions() is what sets the intitial positioning up if I remember correctly … but it has been a while.
As Kiwi says by all means post a bug report, but as you are the first in 18 months to raise this, it may be a while before I look at it due to my other commitments.
Thanks for the quick replies guys. That did help somewhat.
Took a quick look and managed to adjust the code to look at the actual browser window size, if in an Iframe. That now correctly sizes the Clearbox to the browser window. That alone has made a huge difference. :)
Just looking for a way now to pop it all outside the actual Iframe to make it perfect. Will let you know the results when I find that. ;)
That sounds marvellous. Be sure to send me a copy of your changes when you are ready, then I can post them to svn. My email is email@example.com
Really great to have someone else who is skilled in js do this. My sincere thanks.
Well, I've programmed in PHP for many years but sadly, not js. I know a fair bit but, not what I would call a skilled level. :p
What I did try, is to set the Clearbox script in the main html header, then set Clearbox to write to that. Worked fine up to that point, but then I hit an obvious problem. A lot of related stuff has been customised wih hard-coded paths, which kinda makes it fall over at that point. I imagine a lot of work would be needed there to adjust those paths for an Iframe detection. :(
As for the sizing, all I did there was to redirect the document call in the getBrowserSize() function with 'var document = window.parent.document;'. Has no effect outside an Iframe but does size the content better within.
Ah well, was worth try anyhow. Still the best there is. ;)