In each row, I have a column with a blue strip that is generated using jQuery based on the number of rows.
My question is how to add a class to the last strip if the row only has 1 or 2 boxes:
- If the last row has 1 box, add
class='last'
to the strip - If the last row has 2 boxes, add
class='half'
to the strip - If the last row has 3 boxes, do not add any
class
The strips are created with class=dna
.
This is my code snippet:
(function () {
// JavaScript code goes here
})();
Here is what it should look like if the last row only has 2 boxes:
I have solved this issue. If anyone else faces the same problem, you can check out the updated code here - http://jsfiddle.net/v3v7C/10/
Thank you!