jQuery does have its own selector engine that is used in *jQuery selectors*.
However, it does not add any capabilities that are not already there in *CSS
selectors*.

This is a jQuery selector:

$('.foobar').whatever();

This is a CSS selector:

<style type="text/css">
    .foobar { whatever }
</style>

In your code you are using *CSS selectors*. You're using jQuery to add a
class to some elements, and then you are using a CSS selector to do
something with that class.

In this situation, jQuery doesn't add anything beyond what the native CSS
selector engine provides, because the CSS selector is not interpreted by
jQuery.

Your jQuery code is working fine. If you load your page in IE8, then hit F12
and choose IE7 mode, you'll see that it fails to stripe your table. However,
if you then use the DOM inspector in IE8 to look at your table elements,
you'll see that they do have the 'alt' class that you're adding. This is all
working perfectly.

In fact, if you didn't use jQuery at all, but generated the HTML code from
your server with the 'alt' class on alternate rows, I'm sure you would see
exactly the same result in all browsers that you see now.

This suggests another way to approach the problem. For test purposes, don't
use jQuery at all. Simply hand-code a simple HTML page that has all of the
CSS classes you want to use.

Then you can fiddle with your HTML and CSS all you want, without having to
worry about whether the problem lies in jQuery or elsewhere.

Did you see my reply to your other post, where I mentioned that Karl had
pointed out that you can't set the background color of a TR in IE6, but have
to set it on the TD elements instead? I wonder if IE7 has the same problem.
In any case, that's where you should begin investigating.

Along the same lines, if you wonder whether your jQuery code is working as
expected, do not rely simply on the visual effect. Use the DOM inspector and
see if your DOM elements have the attributes you expect. Then you'll know
where to continue troubleshooting.

-Mike

On Sat, Jan 2, 2010 at 3:14 PM, cybervigilante <cybervigila...@gmail.com>wrote:

>
>
> On Jan 2, 3:22 pm, audiofreak9 <audiofre...@gmail.com> wrote:
> > Just an off the hip thought, IE7 may still have the pseudo issues in IE6
> and
> > earlier...
> >
> I thought jQuery had its own model, so it can use stuff that isn't
> even in IE7, like some CSS3 selectors. Anyway, I can't even seem to
> get non-pseudo stuff to work. I'm using Joomla, but I don't think it's
> Joomla since it Does work in IE8
>

Reply via email to