This must have an answer already but I can't find it.
My div
, which I want hidden on page load shows up for a fraction of a second until I explicitly hide it in the document.ready function.
$(document).ready(() => $("#myDiv").hide());
Short of not having it and re-creating it ($.append
/ $.add
) or making it the same background color as its background to hide it, how do I ensure that it remains hidden on page load?
You could toggle CSS properties on the div. display: none;
prevents the element from being rendered at all, and visibility: hidden;
will render it (occupy space for it from the layout), but makes it invisible. When you want to display the element, just remove the property you set.
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加