how to Change text after some interval Using Jquery
we are going discuss common and easy problem .in this post we add a function which create for change text after some interval during page load .you can it according your condition .made easy and simple stay in touch we will update more easy jquery function which is commonly used .
function changeText(texts, time) {
var text = texts.splice(0, 1) [0];
if (text) {
$("#loader-icon").text(text);
setTimeout(function () {
changeText(texts, time);
}, time);
}
}
var texts = ["Loading ...", "Welcome", "Hi", "Sup dude"];
var time = 3000;
window.load = changeText(texts, time);
function changeText(texts, time) {
var text = texts.splice(0, 1) [0];
if (text) {
$("#loader-icon").text(text);
setTimeout(function () {
changeText(texts, time);
}, time);
}
}
var texts = ["Loading ...", "Welcome", "Hi", "Sup dude"];
var time = 3000;
window.load = changeText(texts, time);
No comments: