[buddypress-trac] [BuddyPress] #2248: auto alt class elements - problems when adding ul li to the loop

buddypress-trac at lists.automattic.com buddypress-trac at lists.automattic.com
Fri Apr 9 17:02:43 UTC 2010


#2248: auto alt class elements - problems when adding ul li to the loop
--------------------+-------------------------------------------------------
 Reporter:  nuprn1  |        Owner:         
     Type:  defect  |       Status:  closed 
 Priority:  minor   |    Milestone:  1.3    
Component:  Core    |   Resolution:  invalid
 Keywords:          |  
--------------------+-------------------------------------------------------
Changes (by mrmaz):

  * status:  new => closed
  * resolution:  => invalid


Comment:

 I don't think this is a bug since you are modifying the DOM on your own.
 I'm not sure if we should add bloat to the JS API to automatically support
 a lot of these one-off cases.

 After you insert your html you need to call something like this...

 j('ul#topic-post-list li').removeClass('alt');

 j('ul#topic-post-list li').each( function(i) {
     if ( i % 2 != 1 )
         j(this).addClass('alt');
 });

-- 
Ticket URL: <http://trac.buddypress.org/ticket/2248#comment:1>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list