Jquery / CSS – addClass to first:p of multiple div with specified class
Posted
by j-man86
on Stack Overflow
See other posts from Stack Overflow
or by j-man86
Published on 2010-04-18T13:52:49Z
Indexed on
2010/04/18
14:03 UTC
Read the original article
Hit count: 233
Hello,
I'm using (trying to use) jQuery to add a class to the first paragraph of every div with class of ".djBio" My problem is that it's only adding the class to the first div.djBio, not all divs with that class. Here's the code. I am also using the fancy letter jquery plugin to add the drop cap to the first paragraph (which also is only applying to the first div.djBio, not all)
jQuery(function( $ ){
$('.servicesContent p:first, .about-usContent p:first, .djBio p:first').fancyletter().addClass('firstP');
});
Thanks so much for your help!
© Stack Overflow or respective owner