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

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.


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.

11-12-2009, 04:58 PM

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?


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:


Change it to:


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




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.

11-13-2009, 03:12 PM

First one seems to have fixed it.

Thanks very much.

SC xxxx