JSFiddle - React, Tailwind, and code Playground
by al nmeri
JavaScript
var flyingDivIsVisible = false;
// why use a boolean value in the first place?
if (!flyingDivIsVisible) {
flyingDiv.className = 'is-sticky';
/* meaning "if flyingDivIsVisible is true, let the element class name become the class with sticky styles" */
flyingDivIsVisible = true; // then why this line??
}
}