JQuery .fade method | Quote machine

JQuery .fade method | Quote machine
0

#1

Hi all

I’m trying to use the .fade method so my quotes will fadeIn each time. Not really having any success at the moment. I have fadeToggle on line 19 at the moment which is at least doing something but it’s a disater. Could someone tell me how to get the desired effect? Thanks!


#2

Well, it looks like you are toggling the visibility off.

Try using another fadeToggle after you have loaded the text:

Spoiler
$("#quote").fadeToggle("slow"); // fade out
$("#quote").text(quoteText);
$("#author").text("---  " + author);
$("#quote").fadeToggle("slow"); // fade in

#3

Thanks `Jackson ; got it working perfectly with the below adjustment:

[details=Summary]$("#quote,#author").hide();
$("#quote").text(quoteText);
$("#author").text("— " + author);
$("#quote,#author").fadeIn(500);[/details]