
Originally Posted by
kobo1d
can you please try it out at your computer what happens if you put everything in a DIV and then add another image before the light-button...
Still works fine here. What do you mean by "put everything" I did this:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript">
(function(){
var im2 = new Image();
im2.src = 'lights_on.gif';
jQuery(function($){
var w = $(window), dimmer = $('<div style="position:fixed;z-index:-1;top:0;left:0;display:none;background-color:#000;"><\/div'),
im1 = $('#onoff').toggle(lightsOut, lightsOn).css({zIndex: 11, position: 'relative', cursor: 'pointer', backgroundColor: '#fff'}).attr('src');
function dresize(){dimmer.css({height: w.height(), width: w.width()});}
function lightsOut(){this.title = this.alt = 'Lights On'; this.src = im2.src; dimmer.stop().css({zIndex: 10}).animate({opacity: 0.65, duration: 'slow'});}
function lightsOn(){this.title = this.alt = 'Lights Off'; this.src = im1; dimmer.stop().css({zIndex: -1}).animate({opacity: 0, duration: 'slow'});}
dresize();
$('body').append(dimmer.css({opacity: 0, display: 'block'}));
w.resize(dresize);
});
})();
</script>
</head>
<body>
<div>
<img src="some.gif" alt="Some" title="Some"><br>
<img id="onoff" src="lights_off.gif" alt="Lights Off" title="Lights Off"><br>
<a href="http://www.google.com">Google</a>
</div>
</body>
</html>
and it still worked the same.
Most likely your other image is somehow covering the lights out image or forcing it into a spot where it gets covered by something else, or is no longer on top in some other way. One element can cover another without appearing to do so, also unseen elements can cover other elements. Something like that is probably happening. But it really could be any number of things.
Bookmarks