JQuery.ready is too late: How do I apply CSS Values with JQuery before Rendering?
问题 I want to be able to apply opacity to some elements to make them invisible only if javascript is enabled . I don't want to use display:none because I want the layout to act as if they're in the DOM, so setting opacity to 0 is perfect. I want to be able to set this initial value using Javascript, using JQuery, so I don't have to mess with browser differences on the opacity (and many other) attributes. But if I set opacity to 0 like so: $(document).ready(function() { $("#header").css("opacity",