我有这段代码:
HTML:
<table>
<tbody>
<tr>
<td data-bind="event: { mouseover: switchStatusEditingMode, mouseout: switchStatusEditingMode }">
<span data-bind="visible:statusEditingMode() === 0">New</span>
<select data-bind="visible:statusEditingMode() === 1">
<option value="0" selected="selected">New</option>
<option value="1">Shipped</option>
</select>
</td>
</tr>
</tbody>
</table>
JS:
function ViewModel() {
this.statusEditingMode = ko.observable(0);
var self = this;
self.switchStatusEditingMode = function () {
var newMode = (self.statusEditingMode() + 1) % 2;
self.statusEditingMode(newMode);
}
}
window.onload = function(){
var viewMode = new ViewModel();
ko.applyBindings(viewMode);
};
我的问题是:如何解决IE上的这个问题?谢谢。