I’ve created a custom binding handler with knockout that works in Chrome and Firefox, but unfortunately not in IE8. Its purpose is to change the background colour of an element when the user has hovered the mouse over it. It also sets the background colour (not just on mouse hover) when the data bound to that element is “selected”, but if it becomes unselected the element should go back to its original background colour.
In IE8 the elements don’t go back to the original colour (can’t unselect) as illustrated by this jsFiddle. Can someone please tell me what I’m doing wrong?
Well it was very silly – I was using the shorthand ‘background’ in $e.css(‘background’) instead of ‘background-color’.