On 6/13/11 6:31 PM, tee wrote:
Some pages of the site loads very slow in IE7 (about 15 seconds),
and while the page was loading and (I assume) IE7 was still parsing
the scripts, all the hidden elements shown through. I wander if there
is a way to prevent this.
https://picasaweb.google.com/weblist99/Jun132011?authkey=Gv1sRgCKrj4sKyz-33-gE&feat=directlink
If I understand you correctly, you have sections on the page that are
set to display if JavaScript is off, but want to hide them before the
page loads in the event scripting is enabled?
Wisely, you don't rely on the <noscript> element - that does not work if
scripts are blocked by a firewall.
Here's what works for me. I include this code in the <head> of the document:
<!-- add class="js" to html element if JavaScript is on -->
<script type="text/javascript">
document.documentElement.className='js';
</script>
To display/hide an element, div#part-2 for example, use this CSS:
.js #part-2 { display: none; } /* hide if JS is enabled */
Apologies if I misunderstood. Your example code is beyond my
comprehension this early morning... :(
--
Cordially,
David
*******************************************************************
List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm
Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm
Help: [email protected]
*******************************************************************