gpt4 book ai didi

Javascript onmouseout sleep ?

转载 作者:行者123 更新时间:2023-11-28 16:41:27 25 4
gpt4 key购买 nike

在 Javascript 中,我希望 onmouseout 事件在生效之前休眠/暂停/等待/(不确定这里的术语是否正确)三秒钟。这是如何实现的?

谢谢

最佳答案

function outfunction(event) {
var that = this; // to be able to use this later.
window.setTimeout(function() {

/* you can use 'that' here to refer to the element
event is also available in this scope */
}, 3000);
}

关于Javascript onmouseout sleep ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/384939/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com