Part A
I have the following:
<div class="graphic fadehover" class="last">
<img src="graphic5test image" alt="" class="a" />
<img src="graphic5-2test image" alt="" class="b" />
</div>
with attached css
.fadehover {display: block; height: 162px; margin: 70px 45px 0 0; position:relative; width: 292px; z-index: 100; }
img.a {position: absolute; left: 0; top: 0; z-index: 10;}
img.b {position: absolute; left: 0; top: 0;}
and this script
$(document).ready(function(){
$("img.a").hover(
function() {
$(this).stop().animate({"opacity": "0"}, "slow");
},
function() {
$(this).stop().animate({"opacity": "1"}, "slow");
});
});
I would then like to re-use the script on the following:
<div class="animation" class="fadehover">
<img src="/sun-low image" alt="sun rising" class=""/>
<img src="/sun-hi image" alt="sun rising" class=""/>
<img src="/sun-hi image" alt="sun rising" class=""/>
</div>
with attached css:
.animation {position: absolute; left: 675px; top: 10px; z-index: 25; } /*positions sunrise and hills */
.hills{position: absolute; left: 340px; z-index: 50; }
img.e {position: absolute; left: 0; top: 0; z-index: 10;}
img.f {position: absolute; left: 0; top: 0; z-index:2; }
I know the image links above are wrong but because I'm a newbie stackoverflow won't let me post with them intact.
I would like to re-use the script or a variation of it to be able to fade between the three z-index arranged images (of a sun rising) but don't know how to get a duplicate version of the script to target the new img classes.
Can anyone point me in the right direction for this?
Thanks.