|
1
|
| Kyle Cureau · 技术社区 · 15 年前 |
|
|
1
2
You can have the stylesheet hide specific elements as
However, if you do this directly in the stylesheet you've got accessibility problems, as on a browser without JavaScript available the content will not appear at all. A way around this is to key the hiddenness on a variable that is set from JavaScript before any of the deferrable elements are loaded, for example as a class on
|
|
|
2
0
从可访问性的角度来看,您不应该假设您的样式表实际上正被客户机使用。您的内容应该可以在没有样式表的情况下访问,并且样式表应该只增强表示效果-这是 Progressive Enhancement .
If accessibility matters less, you can hide the entire page (or at least the brouhaha) with
|
|
|
3
0
It's very easy to hide content that's going to be processed by JavaScript. You just need to generate the content itself with JavaScript or set its style to
The problems is accessibility. You normally want the content to be available for tools that do not support all the advanced features, including old browsers, search engines, mobiles phones, screen readers... That's what prevents you from doing what I mentioned in the first paragraph. My advice is to alter your CSS so the content looks good even with JavaScript disabled. (As for your latest requirement, you can use the jQuery.ipanema-girl.js plugin ) |
|
|
code-geek · Jquery根据单选按钮选择隐藏或显示文本字段 11 月前 |
|
|
Dr.0000FF · jQuery按钮点击不显示/隐藏内容 12 月前 |
|
|
user28928120 · 如何在jquery中选择所有类? 1 年前 |
|
Eliable · 使点击计数器和进度条协同工作 1 年前 |
|
Jack Maessen · 在处理程序上使用时如何获取输入类型 1 年前 |