I currently have the following code.
to get the #headerfader to resume running after the second function runs (hovering over and off again to reset the fading text)
I've duplicated the code inside the function.
Is there a more elegant way of handling this?
//FADER TEXT
$('#headerFader').carousel({
interval: 2500,
pause: false
});
//BACK HOME TEXT
$('#headerText').hover(
function(){
$(this).find("h1#masterHeader").animate({opacity:0}, 0, function(){
$(this).css("display", "none");
$('#headerText').find("h1#takemeback").css("display", "block");
$('#headerText').find("h1#takemeback").animate({opacity:1,});
});
},
function(){
$(this).find("h1#takemeback").animate({opacity:0}, 0, function(){
$(this).css("display", "none");
$('#headerText').find("h1#masterHeader").css("display", "block");
$('#headerText').find("h1#masterHeader").animate({opacity:1,});
//FADER TEXT
$('#headerFader').carousel({
interval: 2500,
pause: false
});
});
}
);