I've tested your code in IE6, IE7, FFox3, Opera 9.5 and Safari on Windows and it works fine as expected.
Regards
Maurício




-----Mensagem Original----- De: "Matt Wilson" <mw44...@gmail.com>
Para: "jQuery (English)" <jquery-en@googlegroups.com>
Enviada em: terça-feira, 30 de dezembro de 2008 20:03
Assunto: [jQuery] $(document).ready fires before CSS is rendered?



I've got some links that only serve as anchors for javascript, so I
use CSS to hide them like this:

.requiresjavascript
{
   display:none;

}

and here's the HTML:

<a class="requiresjavascript clearall" href="#">Clear all</a>
<a class="requiresjavascript clearall" href="#">Check all</a>

The idea is that for a browser without javascript, those links don't
appear.

I want to show these links when javascript is available, so I have
this in my $(document).ready() at the top:

$(document).ready(function () {
   $(".requiresjavascript").show();

});

That doesn't work.

However, this approach works fine:
   $(".requiresjavascript").removeClass('requiresjavascript');

So, what am I doing wrong?

Reply via email to