Austin Smith

Detect Javascript Using This CSS Selector

Fri, 02/06/2009 - 12:04

It's a cold day in hell when I care enough about the front-end to make a post like this, but I stumbled across a couple of versions of this and thought I'd post my synthesis. Since it's triggered instantly after is added to the DOM, the remaining HTML loaded by the browser will be styled appropriately! I use it to hide things that I'm going to animate into place with jQuery. Don't ask why I have to animate elements that have already been loaded into the page... it's a sore subject.

<body>
<script type="text/javascript">
$('body').addClass('.js_enabled');