puedes hacerlo asi: <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-js --> var $m = jQuery.noConflict(); // Use jQuery via $j(...) $m(document).ready(function() { //Did you know widget max = parseInt(5); cur = parseInt(2); var Facts = []; Facts[0] = "<span class='txt1'>¿Qué comeremos hoy?, mmmm...</span>"; Facts[1] = "<span class='txt2'>¡Diversión al límite!, te cansarás rápido...</span>"; Facts[2] = "<span class='txt3'>Uniendo piezas, acomodando furnis y arreglando wireds...</span>"; Facts[3] = "<span class='txt4'>¡Shazam!, ¿ya la has visto?...</span>"; Facts = Facts.sort(function() {return Math.random() - 0.5}); setInterval(function() { cur++; // incrementamos en 1 if( cur == Facts.length) { cur=0; } newText = Facts[cur]; $m('#loader-text').fadeOut(function() { $m('#loader-text').html(newText); $m('#loader-text').fadeIn(); }); }, 5000); }); <!-- language: lang-html --> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <p id='loader-text'></p> <!-- end snippet -->