当前位置: 动力学知识库 > 问答 > 编程问答 >

How to append colors alternatives to divs using for loop as Zebra using jquery?

问题描述:

Hi all iam working on jquery I need to add colors to the divs alternatively as zebra here i had worked i got the appending color virtically but i need to make it horizontally also here i need to apply forloop condition to apply colors if i click the vZebra button it should apply colors verticlly if i click the HZebra button colors should appy horizontally with if condition here my worked jsfiddle you can check can any body help me to do this work thanks in advance

Fiddle

网友答案:

Here is the Fiddle. Hope this helps. The horizontal divs are being wrapped inside another container.

网友答案:

why not wrap each row in a div, then you can use the :odd selector on the rows and you can use the :odd selector per div in each row...

分享给朋友:
您可能感兴趣的文章:
随机阅读: