Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您好,我在我的网站中应用了 jquery 显示/隐藏功能,但问题是它首先在加载页面时显示文本,当页面完全加载后,它会正常运行请帮助检查我的网站 http://pligg.marsgibson.info/
只需使用 CSS 选择器首先隐藏文本,在您的示例中,这可以解决问题:
.storycontent { display: none; }
女巫你可以简单地添加display: none;到你的style.css (第 228 行)
display: none;
style.css
如果必须在启动时隐藏元素,最好通过 css 隐藏网页上的元素,因为 javascript 需要一些时间才能激活(因为它会等到页面完全加载)。
我会使用与balexandre相同的方式......