使用jQuery UI Accordion和javascript在主体中加载来防止FOUC [英] Prevent FOUC using jQuery UI Accordion and javascript loading in body
问题描述
我当前的问题是使用jQuery UI Accordion插件并在html-body-tag末尾加载javascript时,我的网页遭受了FOUC的困扰.当我将javascript包含在头部时,一切加载就很好了. html5boilerplate建议将所有JavaScript放在正文标签的末尾以避免页面加载缓慢.
My current problem is that my webpage suffers from FOUC using the jQuery UI Accordion plugin and javascript being loaded at the end of my html-body-tag. When I include the javascript in the head everything loads just fine. html5boilerplate recommends putting all the javascript at the end of the body-tag to avoid slow page loading.
在初始化手风琴之后,我还尝试了手风琴display: none
并将它准备在文档中的show()
,但这也不令人满意.有什么想法吗?
I also tried to display: none
the accordion and show()
it on document ready after I initialized the accordion but that is not satisfying, too. Any ideas?
推荐答案
我确实遇到了问题.阅读该文章-> http://www.learningjquery.com/2008/10/1-避免未格式化内容的闪光方式很有帮助.
I did have the problem. Reading that article -> http://www.learningjquery.com/2008/10/1-way-to-avoid-the-flash-of-unstyled-content helped a lot.
这篇关于使用jQuery UI Accordion和javascript在主体中加载来防止FOUC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!