5 ms·
Was there ever and doubt that it did? How could we excuse hiding/showing "tabs", for example, if it didn't?
by lean 15y ago
Was there ever and doubt that it did? How could we excuse hiding/showing "tabs", for example, if it didn't?
- blauwbilgorgel 15y agoI always advise to show all tabs for users without javascript support. <div style="display: none"> Hidden tab content </div> Else noscript users would have to disable CSS to watch the above hidden tabs, pretty inexcusable. The "correct" progressive enhancement way to do this, is to show all the tabs, and use javascript to hide tabs from view from those that support javascript. Basically it has always been a bad idea to "hardcode" visibility for tabs/divs. For example visit: http://adwords.google.com/support/aw/bin/static.py?hl=nl&page=webinars.cs http://adwords.google.com/support/aw/bin/static.py?hl=nl&... without javascript support. The content is hidden for everyone and pressing expand won't do anything. Compare with: http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=185417 http://www.google.com/support/webmasters/bin/answer.py?hl=en... . Even without javascript support you can still see the examples, because those are only hidden if you have javascript support.
- emp_ 15y agoIndeed PE is a better approach, it's also important to mention that CSS is capable of doing full dropdown/tabs functionality without any javascript (taking advantage of the :hover selector), but I may just be nitpicking your examples more than your intentions.
- mike-cardwell 15y agoI like to use javascript to add a class of "with-js" to the body element immediately after the body tag. Then you can just use css to style everything dependent on javascript. For example: <body> <script type="text/javascript">document.body.className='with-js';</script> Then in CSS you might do this if you want a certain element to disappear only if javascript is enabled: body.with-js #foo { display:none; }