Saturday, January 2, 2010

Re: [jQuery] Not working for me in IE7, but works in IE8

If I tell you the (possible) answer, will you turn off the music on the home page? :-)

Karl Swedberg mentioned in another thread today that you may have trouble in IE6 if you try to set a background color on a TR. It has to be on the TD's instead. Maybe this is the case for IE7 too.

So I would try changing this part of your CSS:

tr {
  background-color: #fff;
}

.alt {
  background-color: #B7FFB7 !important;
}

to:

td {
  background-color: #fff;
}

.alt td {
  background-color: #B7FFB7 !important;
}

-Mike

On Fri, Jan 1, 2010 at 11:45 PM, cybervigilante <cybervigilante@gmail.com> wrote:
I just tried a simple alternate colored table rows in jQuery 1.3.2.
It works fine in the good browsers, works in IE8, but doesn't in IE7.
I thought jQuery worked in IE7. I'm using the IE multitester suite.
(It doesn't work in IE6 either, but I stopped thinking about IE6
except in the "dead" sense ;')

Here's the site - it's a table of religious days on the front page.
http://celestialchurchqueens.org

Here's the code - very basic. The alt class gives a light green color
in IE8. I thought maybe my testing suite is off so I'd like to know if
anyone else sees a lack of color bands in IE7.

jQuery(document).ready(function() {
 jQuery('tr:odd').addClass('alt');
});

This is a Joomla site, and since Joomla has an ancient version of
MooTools embedded, I'm using jQuery instead of $ in compatibility mode.

No comments: