Jquery 显示/隐藏:在 Internet Explorer 中缓慢隐藏会导致可怕的效果..想法?
我实现了 这个 Jquery show/hide 代码,一切正常很好,除了我想隐藏的框,使用慢速 JavaScript 浏览器(IE 6)在加载网页(或至少加载所有 JS)后隐藏。由于页面非常复杂,这需要一段时间,导致显示内容的效果非常糟糕,然后它被隐藏了..太糟糕了..
我确实知道我可以使用 CSS 设置 TO_HIDE_BOX display=none ,然后稍后使用js,但我不知道该怎么做,因为没有启用js的人将无法看到隐藏的内容。
你们有关于如何消除这种可怕影响的想法吗?
I implemented this Jquery show/hide code and everything works fine except that the box that I want to hide, with slow javascript browsers (IE 6) is hidden after the webpage has been loaded (or at least all the JS). And as the page is pretty complex this takes a while resulting in the very bad effect of displaying contents and then it gets hidden.. Awful..
I do know that I can set the TO_HIDE_BOX display=none with CSS and then change it later with js, but I don't what to do that because people without js enabled won't be able to see the hidden contents.
Do you guys have ideas on how to remove this awful effect?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你可以把
.showDivWithNoJS { display: none; }
在你的 css 和你想要隐藏的元素上的类(你可能想给它一个更短的名称:),然后在页面顶部执行此操作:这会以良好的效果显示你的元素如果他们启用了 JavaScript,如果没有,它会立即显示它们,因为无论如何他们都没有获得显示效果。
You can put
.showDivWithNoJS { display: none; }
in your css and the class (which you'll probably want to give a shorter name :) on the elements you want hidden, then do this at the top of the page:This shows your elements with a nice effect if they have JavaScript enabled, and if not it shows them immediately, since they're not getting the show effect anyway.