このノックアウトの例にあるように、ノックアウト イベント バインディングを使用します。
http://knockoutjs.com/documentation/event-binding.html
次に、次のようにします。
<button data-bind="event: { mouseover: makeToolbarVisible, mouseout: disableToolbar }">Mouse over me</button>
<button data-bind="visible: toolbarVisibility">Details</button>
ビューモデル:
var toolbarVisibility = ko.observable(false);
var triggerComputed = ko.observable(false);
function makeToolbarVisible() {
toolbarVisibility(true);
};
function disableToolbar() {
triggerComputed(true);
};
var comp = ko.computed(function () {
triggerComputed(false);
toolbarVisibility(false);
console.log("Disabled after 3 sec");
return triggerComputed();
}).extend({ throttle: 3000 });
おそらく最も洗練されたソリューションではありませんが、仕事は完了します。