PDA

View Full Version : Simple Controls Gallery v1.3 Transparent Background



Clarkie
11-12-2009, 03:52 PM
1) Script Title: Simple Controls Gallery v1.3

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/simplegallery.htm

3) Describe problem: Is there any way to make the Gallery background transparent? So that I can make a portrait gallery and have occasional landscape images as .gif files with transparent top and bottom and the page background will show through.

Or, at a pinch, have a coloured background other than Black.

Thanks for a great script.

C.

jscheuer1
11-12-2009, 04:18 PM
Add this to your style section:


#simplegallery1, #simplegallery1 .gallerylayer {
background-color: transparent!important;
}

where simplegallery1 is the wrapperid for that gallery. But I think using a solid color will be better, otherwise transparent image sections may bleed through to other images in the gallery. One can set the background to be an image though, say your page has a background image, you could use the same one and use the background-position style property to (hopefully) get it to line up with the page's background image.

In any case, don't forget to use the !important keyword as shown. This is required to override script assigned styles.

Clarkie
11-12-2009, 04:58 PM
Hi

Works great in FireFox but in IE 8 it has the word 'null' in the top left corner of the images with some transparency.

Should that be?

SC

jscheuer1
11-12-2009, 05:44 PM
Well, that sort of thing has come up before with some of the scripts written by DD during a certain period where the author got 'null happy'. I think in this case it's due to this line in the main script:


setting.gallerylayers[setting.bglayer].innerHTML=null

Change it to:


setting.gallerylayers[setting.bglayer].innerHTML="";

and that should take care of it. But you may also have to change this line as well:


setting.descdiv.innerHTML=null

to:


setting.descdiv.innerHTML="";

In IE and some other browsers, setting the innerHTML value to the null object, which technically should empty it, via automatic type conversion to a string (innerHTML is non-standard and can be considered either an object or a string), results in the literal string 'null'. This will not mess up other browsers which consider it an object, as the empty string will be converted to the empty object by them.

Clarkie
11-13-2009, 03:12 PM
Hi

First one seems to have fixed it.

Thanks very much.

SC xxxx