Would like some feedback

Would like some feedback
0

#1

Just finished the random quote machine. Could you guys take a look at it and give me feedback. Hosting my JSON quotes file on dropbox so you may experience some latency on getting new quotes :smirk:
Was trying to get my new quotes to fade in but for some reason all that happens is they flicker once after loading. If anyone can help with that I’d be much obliged, for now i have commented that code until i figure out how to make it work


#2

Hi,

looks good to me on all screen widths :thumbsup:

Your randomNumber variable inside the getQuote function was undeclared, so the text color didnt change. putting var in front it fixes that.

Mark


#3

.animate accepts a third parameter: a callback function, which will execute after the element has done animating. This is where you want to put the code that displays the new quote.

$("#text").animate({opacity:0}, "slow", function() {
  $("#text").html('"' + object.quote + '"' + "<br>" + object.author);
  $("#text").animate({opacity:1}, "slow");
});

#4

Thanks for the feedback. The randomNumber variable is working as expected but you’re right, I should have used the var keyword as the variable is scoped incorrectly. My randomNumber has global scope.


#5

Thanks, this is exactly what I was looking for.