Changing background colour with jQuery. Reset to default

friendl09

New Member
I have a \[code\]<ul>\[/code\], in which I am using jQuery UI Sortable to allow the sorting of the contained \[code\]<li>\[/code\]s.The \[code\]<li>\[/code\]s are styled with alternating background colours with :\[code\].list-striped li:nth-child(odd) { background-color: #f9f9f9;}\[/code\]I am using the Sortable start and stop functions to create a nice transition when the \[code\]<li>\[/code\] is dragged like so:\[code\]$( ".sortable" ).sortable({ start: function(event, ui){ $(ui.item).animate({ 'background-color': '#333333' }, 'fast'); }, stop: function(event, ui){ $(ui.item).animate({ 'background-color': '' }, 'fast'); } });\[/code\]My issue now, is that when we clear the background colour, it doesn't revert to the previous background colour (or inherit the background colour it should from the CSS). Is what I am trying to achieve possible?
 
Back
Top