0

help!

how to make loading screen? example i use this, "loading.", " loading..", "loading..." each second, the "dot" next to the "loading" word increase. how i can make this using "document.innerHTML"?

15th Apr 2017, 2:48 AM
miracle
7 Réponses
+ 6
Check this simple preload example: https://code.sololearn.com/W39ioBVR1eJn/?ref=app ( uncomment last images element if you have quick connection, and clear cache to test again without instant loading wich avoid displaying load message )
15th Apr 2017, 4:13 AM
visph
visph - avatar
+ 3
var body = document.getElementsByTagName('body')[0]; body.innerHTML = 'Loading'; setInterval (function(){ body.innerHTML += '.'; },1000);
15th Apr 2017, 3:37 AM
Ashwani Kumar
Ashwani Kumar - avatar
+ 3
What is fieldset box for you?
15th Apr 2017, 3:40 AM
Ashwani Kumar
Ashwani Kumar - avatar
+ 3
[0] because ByTagName it returns an array and i want 0th element of it. You can also do it ById, in this you get a single element, hence any index is not required.
15th Apr 2017, 3:51 AM
Ashwani Kumar
Ashwani Kumar - avatar
0
thanks.. btw how to put the fieldset box to the center?
15th Apr 2017, 3:39 AM
miracle
0
oh..nevermind.. however why there is "[0]" next to the ('body')? & can i use getElementbyId instead byTagName?
15th Apr 2017, 3:49 AM
miracle
0
ok..nice
15th Apr 2017, 3:54 AM
miracle