I am fairly new to JavaScript, but have prior experience with front-end development as a whole. I am attempting to have JS iterate over the list provided and display the results on my site. Each item will be displayed once before moving onto the next in the list. When it reaches the end, the last item will be permanently displayed. I am using the Textillate JS library.
What's wrong with my code?
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script>
var title-transitions = [
"Create Solutions",
"Build Relationships",
"Design Brands",
"Redifine Excellence"
],
transitionCounter = 0,
looped = false,
textillateSettings ={
loop:false,
in:{
callback:fucntion(){
if(!looped) $('h1.introduction-heading').fadeOut(3800);
}
}
};
var $h1 = $('h1.introduction-heading');
$h1.introduction-heading(textillateSettings);
var animationHero = set Interval(function(){
transitionCounter =
(transitionCounter == transition.legnth -1)
? 0 : transitionCounter + 1;
if(transitionCounter == 0){
looped = true;
clearInterval(animatedHero);
}
$('h1.introduction-heading').remove();
$('h1.introduction-heading')
.text(transition[transitionCounter])
.textillate(textillateSettings);
}, 6000);
</script>
Here is the url to the textillate site, if it could be of any assistance.