Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@SpencerBeige It's a setInterval(). There's no requirement for a loop, it will be called every 100 milliseconds
There should, however, probably be a way to clearInterval() when the width has reached its desired size -
@NufMeister I have before, but not regularly. Mainly due to lack of IE support.
I'm an old school JS though. I like my constant variables beginning with an _ -
@NufMeister I'm aware I could (and I may be stuck in my ways here), but I prefer clean looking code
A lot of the ES6 compilers tend to put gunf in where it isn't needed, in my opinion
I'm primary a Web developer, and currently I see no need for the use of let or consts
Even in some of the Web Apps I've built
var i = 0;
setInterval(function(){
document.getElementById("el").style.width = i + "px";
i+=10;
},100);
And, children, this is how we were used to create animations years ago
undefined