How do I pass a variable to function
Hi I am creating a testimonial/quote rotator using the following function:
$(document).ready(function(){
$('#testimonials .slide');
setInterval(function(){
$('#testimonials .slide').filter(':visible').fadeOut(500,function(){
if($(this).next('div.slide').size()){
$(this).next().fadeIn(500);
}
else{
$('#testimonials .slide').eq(0).fadeIn(500);
}
});
},20000);
});
That reefers to:
<div id="testimonials">
<Div class="slide">
<p class="quote">Quote one here.</p>
</Div>
<Div class="slide">
<p class="quote">Quote two here.</p>
</Div>
</Div>
I would like if possible to set a different time interval (currently 20000 for all) for each quote, how can I pass a value from the html to the function?
I am as you have probably already guessed new to jQuery, any help greatly appreciated.