I made a large form, which has many elements. I use javascript(jquery) to make this form have a step-by-step effect. The problem is that, when the page is loading and before the javascript behavior is triggered, the form shows in a mess and all of its element are shown. Any ideas of improving this?
Share
A common term for this behavior is “flash of unstyled content” (which will be useful when searching for solutions). Technically your content has been styled (assuming the page is structured and parsed correctly), but your JavaScript is applying additional style rules and it doesn’t do that until the page is loaded.
One technique I regularly use is to set elements to
display:noneuntil I am ready to work with them. This isn’t always practical, as sometimes the element must be visible and/or have a display box for a particular piece of code to work.See this article for ideas.