How to affect an Li with a certain class in jQuery?
<p>I am using a jQuery gallery plugin, the thumbs are all in an unordered list and the main image is to the right in a div.</p>

<p>The plugin adds the class "selected" to the li whose main image is currently being shown. As soon as the plugin moves on to the next image, the selected class is removed from the li and added to the next li.</p>

<p>I want to affect the li that currently has the class "selected" applied to it. I can't just do this:</p>

<p><code>$('li.selected').whateverRules();</code></p>

<p>because jQuery is applying the class dynamically, the class isn't there from the document ready state hence it doesn't work.</p>

<p>I also can't use <code>.live()</code> because I have no event to attach. So how can I work with this?</p>

<p>How can I affect the li which currently has a class of "selected" if this class was added dynamically?</p>
