[jQuery] Re: Striping Sometimes Doesn't Work
On Thu, Feb 19, 2009 at 5:29 PM, MauiMan2 cmzieba...@gmail.com wrote: The following code snippet: $('OL.codeSample LI:even').addClass('even'); is working on one of my sites to zebra striping to list items but is not working on another one even though both have jQuery 1.2.6 in place. The site where it's not working is here: http://developer.cmzmedia.com/?p=115 Any ideas? Looks like the page in question is using 'jQuery' as the jQuery namespace instead of the $ ? jQuery('OL.codeSample LI:even').addClass('even'); ? -- I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success.
[jQuery] Re: Striping Sometimes Doesn't Work
The site where it's not working is here: http://developer.cmzmedia.com/?p=115 Any ideas? Pulling up Firebug's console and typing jQuery('OL.codeSample LI:even').addClass(even) stripped the middle box just fine Not sure why you are mixing jQuery and $, but if you look in the console during page load, you can see it fire $ is not a function, meaning somewhere in the code you are using noConflict (although it's not shown in the view source, but it's indeed somewhere, *or* something is conflicting with $)
[jQuery] Re: Striping Sometimes Doesn't Work
I found the noConflict() call at the very end of this file: http://developer.cmzmedia.com/wp-includes/js/jquery/jquery.js?ver=1.2.6 On Feb 19, 3:46 pm, MorningZ morni...@gmail.com wrote: The site where it's not working is here: http://developer.cmzmedia.com/?p=115 Any ideas? Pulling up Firebug's console and typing jQuery('OL.codeSample LI:even').addClass(even) stripped the middle box just fine Not sure why you are mixing jQuery and $, but if you look in the console during page load, you can see it fire $ is not a function, meaning somewhere in the code you are using noConflict (although it's not shown in the view source, but it's indeed somewhere, *or* something is conflicting with $)
[jQuery] Re: Striping Sometimes Doesn't Work
Did you define the .even class? I don't see it in Firebug.
[jQuery] Re: Striping Sometimes Doesn't Work
It's defined in the CSS. It's only the $ and jQuery issue. The code: jQuery('OL.codeSample LI:even').addClass(even); works fine. On Feb 19, 4:00 pm, Dave Methvin dave.meth...@gmail.com wrote: Did you define the .even class? I don't see it in Firebug.
[jQuery] Re: Striping Sometimes Doesn't Work
Okay, I'm not a total jQuery newbie but, yeah, I've gotta get this $ and jQuery stuff straight. Part of the problem is the stuff that was already there with the WordPress template I'm using. From what I do know about it I'm not sure that they should've put the noConflict thing at the end of the jQuery 1.2.6 file that was included with the template. Still trying to process this all but you have all definitely got me on the right track... On Feb 19, 6:05 pm, James james.gp@gmail.com wrote: It's defined in the CSS. It's only the $ and jQuery issue. The code: jQuery('OL.codeSample LI:even').addClass(even); works fine. On Feb 19, 4:00 pm, Dave Methvin dave.meth...@gmail.com wrote: Did you define the .even class? I don't see it in Firebug.