Created
February 22, 2017 11:34
-
-
Save elgamine-dev/00d4ff85195c87e507fe98de7e930898 to your computer and use it in GitHub Desktop.
Trying blocks !
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
var span = $('span') | |
var current = 1; | |
var words = ['déchire', 'kicks ass', 'is aswesome', 'gets the shit done', 'is very useful']; | |
setInterval(function(){ | |
changeWord(span, words, current++); | |
},5000) | |
function changeWord(el, words, pos){ | |
let i = pos % words.length; | |
el.html(words[i]) | |
} | |
changeWord(span, words, 0); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
</head> | |
<body> | |
Blocks <span></span> ! | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> | |
<script src="app.js"></script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment