我的选项卡式 jquery 正在加载所有部分,然后加载第一个选项卡式,如何停止?
这就是我正在研究的内容:http://www.iamjrilla.com/sample.html。
如果你愿意的话,需要一段时间才能真正“安定下来”。它显示每个选项卡中的所有内容(首次加载页面时),就像在 Dreamweaver 和 Dreamweaver 中显示的那样。然后它最终加载第一个选项卡“home”。有什么办法可以改变这个吗?
This is what I'm working on: http://www.iamjrilla.com/sample.html.
It's taking a while to actually "settle down" if you will. It shows all the content in each tabbed (when page is first loaded) as it would show in dreamweaver & then it finally loads the first tab which is "home". Is there a way I can change this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
所有选项卡最初都是可见的,因为在文档准备好并且所有选项卡 div 都以
display: block
开头之前,选项卡不会激活。当 jQuery 选项卡激活时,除第一个选项卡之外的所有选项卡 div 都将通过display: none
隐藏。也许最简单的方法是将
style="display: none;"
添加到除第一个之外的所有选项卡 div。这将在页面加载时显示第一个面板并隐藏其他面板;然后,当页面加载完成并且选项卡被激活时,通过单击页面顶部的选项卡即可使用其他面板。All the tabs are initially visible because the tabs don't activate until the document is ready and all your tab divs start off with
display: block
. When the jQuery tabs activate, the all the tab divs except the first will be hidden withdisplay: none
.Probably the easiest thing to do would be to add
style="display: none;"
to all the tab divs except the first one. That will show the first panel while the page is loading and keep the others hidden; then, when the page has finished loading and the tabs are activated, the other panels will be available by clicking on their tabs at the top of the page.从概念上讲,在其他选项卡中加载一个空的 div,然后在 onload() 或 jQuery(document).ready() 之后使用 ajax 填充这些选项卡中的内容。
Conceptually, load an empty div in the other tabs, then use ajax to fill in the content in those tabs after onload() or jQuery(document).ready().
我认为在每个 tabcontent div 上包含类 hidetabs 就可以解决这个问题。其余的将由 jquery tabs js 处理。
I think including the class hidetabs on every tabcontent div would solve the purpose. The rest would be handled by jquery tabs js.