PDA

View Full Version : Lightbox - How can I get js to display at a page position when clicking on thumbnail



Mark Ellis
11-10-2013, 02:23 PM
I use the free Google Sites for my websites. I use Lightbox and it works very well in an iFrame in Google Sites. It's just a matter of using xml files as gadgets instead of code in the header html itself. The XML file replicates an html page as users are not given access to the head area of web pages in Google Sites.

But when one clicks on a thumbnail image in the lightbox gallery, the shown large image might be way above the point (image thumbnail) when one has clicked on the page.

I wonder if it is possible with Javascript to make the page jump to a point on the page (in the same way that an a link jumps you to a place on the page) so that the full size image will be seen no matter where the clicked on thumbnail is on the page - rather than clicking on an image thumbnail and just seeing a blackened screen as it does now if one clicks on a thumbnail lower down the page. Putting a <a name=”display”></a> into the html right before the iFrame for the XML file is easy enough - but what do I need to do in the relevant js file to make the screen jump to http://www.dogshowcorscombemosterton.info/photos-of-2011-show#display :confused:

Example is http://www.dogshowcorscombemosterton.info/photos-of-2011-show
The images of the first gallery are in the XML file of corscombe-2011-gallery-of-winners.xml
All relevant files are at the bottom of that page

Thanks