niveanvp73 Posted July 21, 2008 Share Posted July 21, 2008 Hi...I have a function that connects a lightbulb with opacity of a picture. Click on the lightbulb and see how it works (only in IE7 or Firefox lower version than 3.0) here:http://wwwart.cz/lighton.html The problem is, it works in IE7, Firefox 2.1, but NOT in Firefox3.0.Has someone an idea what could be the cause?Here's code of the script:cc=0;function changeImage() /*this function creates the effect of switching on or off the bulb...*/{if (cc==0) {cc=1;document.getElementById('myimage').src="images/bulbon.gif";}else{cc=0;document.getElementById('myimage').src="images/bulboff.gif";}}dd=0;var c=0; /*c stands for opacity of the picture under the lightbulb*/var t;var t2;function timedOpacity(){if (dd==0){dd=1;fce()}else{dd=0;fce2()}}function fce(){clearTimeout(t2);document.getElementById('img').style.cssText = "opacity: " + (c / 100) + "; filter:alpha(opacity=" + c + ")";c=c+10;if (c>99) returnvar t=setTimeout("fce()",1);}function fce2(){clearTimeout(t);document.getElementById('img').style.cssText = "opacity: " + (c / 100) + "; filter:alpha(opacity=" + c + ")";c=c-10;if (c<0) returnvar t2=setTimeout("fce2()",1);}Thanks for any idea Link to comment Share on other sites More sharing options...
justsomeguy Posted July 22, 2008 Share Posted July 22, 2008 If you inspect the document in Firefox 3 with Firebug you can see that the room image receives the click, not the light image. You might be able to fix that with z-index. Link to comment Share on other sites More sharing options...
niveanvp73 Posted July 22, 2008 Author Share Posted July 22, 2008 YES! That was the reason! Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.