EDITABLE CODE:
LiveDemo:jQuery - toggleClass() Method using function
Note: Different styles are applied to list items based on their index value using a function.