PDA

View Full Version : Lightbox - revealing hidden form



ollyno1uk
03-07-2009, 02:27 PM
1) Script Title:
lightbox

2) Script URL (on DD):

http://www.dynamicdrive.com/dynamicindex4/lightbox2/index.htm

3) Describe problem:

Everything works great apart from after the image is closed it reveals a totally seperate hidden dropdown form.

Here is an example - http://www.nationwideltd.co.uk/glass-verandas.html

if you click any of the images the lighbox shows. Close it, then look towards the left navigation menu on the page and you will see two drop down boxes that should be hidden.

Any tips would be great on stopping this.

Thanks a lot

jscheuer1
03-07-2009, 07:37 PM
For backward compatibility in IE 6 and earlier where select elements show through all overlaying content, Lightbox hides all selects when opened, and reveals all selects when closed. This is done via their visibility style property.

What you are observing shouldn't be happening though because their container is still visibility hidden, and visibility is supposed to be inherited. But obviously it is happening. So here is what I suggest, in lightbox.js find this code:


function showSelectBoxes(){
var selects = document.getElementsByTagName("select");
for (i = 0; i != selects.length; i++) {
selects[i].style.visibility = "visible";
}
}

Change it to:


function showSelectBoxes(){
var selects = document.getElementsByTagName("select");
for (i = 0; i != selects.length; i++) {
selects[i].style.visibility = "";
}
}

That will, instead of setting the visibility property explicitly to visible, allow it to revert to whatever it was, which in this case was nothing, so should work out well. It also should have no adverse effect upon any other select(s) that you have on the page. If not, we can take more elaborate measures.

ollyno1uk
03-08-2009, 10:23 AM
Hi

Thanks a lot for your help here - this seems to have resolved the problem. Great stuff.

Thanks again

Olly