views:

336

answers:

2
+2  A: 

You could consider implementing and learning jQuery, which has a few plugins to fade things as well as built in functions such as fadeIn(), fadeOut(), etc.

You could use multiple divs fade using a selector like this

$('#div1, #div2').fadeOut(1000);

Good luck!

Extra Help

More specifically if at this stage you'd like to get started on fading Div's, check out the jQuery docs at http://docs.jquery.com, more specifically the selectors (for selecting the div) and the effects (for learning how and which functions to use).

alex
A: 

I've run into a similar problem doing the banner cycling on http://www.cwu.edu/~campuslife . While Jquery's fadeout function is nice, it's not going to be adequate for what you're doing. I recommend the Jquery cycle lite plugin if you're just fading between images.

To set this up, you'll need to add the jquery script, the cycle plugin, and a third .js file in your document, like so:

<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="cycle.js"></script>
<script type="text/javascript" src="imgrotation.js"></script>

Then, in the imgrotation file, add the following lines:

$(document).ready(function(){
    $('#div1, #div2').cycle()
})

That should be all you need to cycle through images in multiple divs.