I have this code
$(document).ready(function(){ var fade_in = function(){ $(".quote").fadeIn(); } setTimeout(fade_in, 2000); var fade_out = function() { $(".quote").fadeOut(); } setTimeout(fade_out, 10000); });
What he does is that the div "quote" slowly disappears, remains for a few seconds, and then disappears. I want all this to happen when the user is on the page, if you are not on the page, the text disappears, disappears, and you skip it. How can i do this?
Josef source share