After searching for a jQuery animation that would constantly change text within a paragraph, I stumbled upon a solution at this link : Text changing with animation jquery. However, I encountered a challenge as I wanted to include a bootstrap button beneath the paragraph. The issue arises when the button starts moving up and down while the opacity is null.
var words = ["text1", "text2", "text3","text4","text5"];
var idx = 0;
$("#description").fadeOut("slow");
setInterval(function(){
$("#description").stop().html(words[idx]).fadeIn("slow",function(){
idx++;
$("#description").delay(400).fadeOut("slow");
if (idx == 5) {
idx = 0;
};
});
},1800);
<p id="description"></p>
<p>Hello world</p>
You can experience the issue on a fiddle here: https://jsfiddle.net/km19e3jf/2/