$(document).ready(function(){
$(".def").click(function(event){
$("#l1").attr('class', 'active');
$("#l2").attr('class', 'inactive');
$("#l3").attr('class', 'inactive');
$("#readmore").attr('action', 'http://www.facebook.com');
$(".summary").fadeout(1000, function(){
$("#s1").text('text here');
$(".summary").fadein(1000);
});
});
$("#l2").click(function(event){
$(".summary").fadeout(1000, function(){
$("#l2").attr('class', 'active');
$("#l1").attr('class', 'inactive');
$("#l3").attr('class', 'inactive');
$("#readmore").attr('action', 'http://www.google.com');
$("#s1").text('text here 2');
$(".summary").fadein(1000);
});
});
$("#l3").click(function(event){
$(".summary").fadeout(1000, function(){
$("#l3").attr('class', 'active');
$("#l2").attr('class', 'inactive');
$("#l1").attr('class', 'inactive');
$("#readmore").attr('action', 'http://www.youtube.com');
$("#s1").text('text here 3');
$(".summary").fadein(1000);
});
});
});
The script above is whenever the specified link is clicked with the id or class it changes the text of an area of the website...but I would also like it to auto rotate every 10 seconds...what would be the best way of implementing this into this script...
Thanks! You can view whole page - here - link