forum

Home / DeveloperSection / Forums / How to add striped styling to a list of items?

How to add striped styling to a list of items?

Elena Glibart 1988 26-May-2015

I’m want to striped styling to a list of items with knockoutjs. The class on the div below should be even or odd depending where it is in the list.

<div class="Headlines loader" 
     data-bind="css: { loader: headlines().length == 0 },
                       template: { name: 'recentHeadlinesTemplate',
                                   foreach: beforeHeadlineAddition,
                                   beforeRemove: function(elem) { $(elem).slideUp() },
                                   afterAdd: slideDown }">
</div>
 
<script type="text/html" id="recentHeadlinesTemplate">
    <div class="even">
        ${Title}
    </div> 
</script>


Updated on 26-May-2015

Can you answer this question?


Answer

1 Answers

Liked By