javascript - How can I fadeIn/fadeOut of text using jQuery (or CSS)? -


i'm building random quote generator , use fadein/fadeout function when switching between quotes when prompted button click. i'm not sure how target text in jquery, since printing array directly javascript this:

$('.show-quote').text(randomquote); 

here project far:

http://codepen.io/biancalelei/pen/vlejvd

i think want: http://codepen.io/anon/pen/gomgql

$('.show-quote').fadeout(300, function(){    $(this).text(randomquote).fadein(300) }); 

first, fade out in 300ms. when done attached function executed. changes text , fades in.

if don't want background fade out well, can put text in <div>: http://codepen.io/anon/pen/omxevk


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -