|
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 ) |
|
OREO · 如何在不实际单击复选框的情况下选中它 1 年前 |
|
|
Dan · 在元素外部设置html点击处理程序点击后立即触发 1 年前 |
|
|
Mero · Svelte在父事件调用上调用新的嵌套事件处理程序 2 年前 |
|
|
iorice · usercontrol dll中的组件事件 2 年前 |
|
|
Awin · 点击事件功能不适用于Vue组件 2 年前 |
|
|
Kiwi · 将可共享的自定义数据添加到事件MS图形api 2 年前 |