View Single Post
Old 12-03-2012, 11:54 PM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,168
Thanks: 59
Thanked 3,992 Times in 3,961 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Well, first of all, you aren't really using basic JavaScript when you do that.

You are using the jQuery library. So some of the code is going to be a bit (or a LOT!) different than if you were using ordinary JavaScript.

It is kind of like you are using a GPS navigation system (e.g, a TomTom or similar) but never learned how to read a map. You are trusting that your navigation system will always know how to read the map for you.

But to directly answer your question:
Code:
<script type="text/javascript">
$(document).ready(function() {
    $('.slideshowA').cycle({
		fx: 'fade',
		speed: 4000,
		delay: 0
	});
    $('.slideshowB').cycle({
		fx: 'fade',
		speed: 4000,
		delay: -1000
	});
    $('.slideshowC').cycle({
		fx: 'fade',
		speed: 4000,
		delay: -2000
	});
});
</script>
I don't think you an make it much shorter than that without major changes to how you code it.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote