View Full Version : Ultimate Fade-in slideshow - moz-opacity issue

02-05-2008, 12:11 AM
1) Script Title: Ultimate Fade-in slideshow

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm

3) Describe problem:

I'm using this script to cycle through logo images, each image is of a set width with a solid white background, and the logo centered over the white background and saved as a jpeg. All images use no transparency at all. The logos are of differing shapes & sizes.

I've noticed in Firefox (using Firebug) that the maximum opacity gets to 0.990099 due to the division by 101 for moz-opacity on lines 78 and 134, which results in darker colours in background images creating a shadow under the top image.

As a quick test I've changed the /101 to /100.0001 which results in opacity getting to 0.999999 and the shadows are no longer visible.

I assume the script was written this way due to problems handling an opacity of 1 in mozilla, could you possibly share any info you have on the issue so that I can determine the best way to handle it? Any suggestions you have will also be welcomed.


02-05-2008, 12:53 AM
It would require an exceptionally sensitive monitor to see any difference between:




-moz- or any other type of opacity. However, I imagine it is possible. Do you still have:

var fadebgcolor="white"

set in the script?

In fact, in the most recent versions of FF, there is nothing wrong with shifting to an opacity value of 1.

Older versions of FF and NS (perhaps even current versions of NS) had a bug whereby if an element was shifted from less than 1 to 1 (opacity or -moz-opacity), it would flash. Opera may still, and certainly recently still had this problem as regards generic opacity which it supported beginning with v 9.0 (current release is 9.24, I believe).

The bottom line is, as long as you are not worried about avoiding this 'flash' in older browsers (and perhaps some current niche ones), either 1 or 0.999999 should be fine. If you are concerned about these browsers, you should test 0.999999 in them, it should be OK, as long as it isn't automatically rounded off to 1 by any of the browsers in question.

And, as I say, the worst that will happen in these browsers that do have an issue with it is a slight, but noticeable flash as the object achieves full opacity.

I just tested in NS 7.2, which is the only browser of that sort I currently have real handy (I have Opera 9.24, but it has no problem with opacity 1), and NS 7.2 had no problem using 100.0001 as a divisor.

02-05-2008, 01:01 AM
Thanks a lot for the information.

Most people viewing the site probably wouldn't have noticed the difference but I did and it has jumped out at me since then.

We probably would be safe going up to 1 but 0.999999 solves the issue without introducing others so I'll stick with that.

Once again thanks for the informative reply, very much appreciated.