在 Javascript "OpenSel" 上使用延迟
Using delay on Javascript "OpenSel"
我试图在我的代码的某些操作中使用延迟,但我不知道如何在 OpenSel() 上使用这个函数。
示例:
function OpenSel(e){1==e?(
document.getElementById("acin").style.bottom="0",
document.getElementById("inin").style.bottom="0"
我只想在 acin 上使用延迟,但如果我更改 css 转换,此元素将永远被延迟。如何只在一个动作中使用延迟?
谢谢!
您可以将调用包装在 Javascript timeout
中
setTimeout(function(){ document.getElementById("acin").style.bottom="0"; }, 500);
这将运行0.5s后的代码
我试图在我的代码的某些操作中使用延迟,但我不知道如何在 OpenSel() 上使用这个函数。
示例:
function OpenSel(e){1==e?(
document.getElementById("acin").style.bottom="0",
document.getElementById("inin").style.bottom="0"
我只想在 acin 上使用延迟,但如果我更改 css 转换,此元素将永远被延迟。如何只在一个动作中使用延迟?
谢谢!
您可以将调用包装在 Javascript timeout
setTimeout(function(){ document.getElementById("acin").style.bottom="0"; }, 500);
这将运行0.5s后的代码