drop down menu - jQuery Odd Even is Adding Even to an Odd Element -



drop down menu - jQuery Odd Even is Adding Even to an Odd Element -

jquery('li.has-sub ul li:even').addclass('even'); jquery('li.has-sub ul li:odd').addclass('odd');

the classes beingness added drop downwards menu. in 1 drop downwards menu classes added correctly dropdown adding class even odd elements. think jquery might counting of list items together, still doesnt explain why counting 1 even. can see problem on url:

the menu yellowish background starting rafting trips. http://bit.ly/xaemh7

i have tried adding this in effort create jquery count ul in question no luck.

jquery behaving correctly given code:

jquery('li.has-sub ul li:even').addclass('even'); jquery('li.has-sub ul li:odd').addclass('odd');

if alter to:

jquery('li.has-sub').each(function(){ jquery('ul li:even',this).addclass('even'); jquery('ul li:odd',this).addclass('odd'); });

should work.

jquery drop-down-menu

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -