Created
October 25, 2018 05:19
-
-
Save jremi/2ae2b047bddc0765438660b4e91b735f to your computer and use it in GitHub Desktop.
Simple Vanilla JS - Dot dot dot progress loader
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> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>Dot loader</title> | |
</head> | |
<body> | |
Loading<span id="dots"></span> | |
</body> | |
<script> | |
let dots = document.getElementById('dots'); | |
let loader = setInterval(()=>{ | |
if(dots.textContent === ''){dots.textContent = '.';} | |
else if(dots.textContent === '.'){dots.textContent = '..';} | |
else if(dots.textContent === '..'){dots.textContent = '...';} | |
else if(dots.textContent === '...'){dots.textContent = '';} | |
},250); | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment