【发布时间】:2013-02-07 11:20:52
【问题描述】:
我有下面的代码,每次单击按钮时,我的手机 LED 都会闪烁,但我还需要 LED 在 3 秒后自动关闭。不知道怎么做,请帮忙。
input type="button" onclick="ipwajax('enabletorch')" value="打开LED"
【问题讨论】:
标签: led flashlight
我有下面的代码,每次单击按钮时,我的手机 LED 都会闪烁,但我还需要 LED 在 3 秒后自动关闭。不知道怎么做,请帮忙。
input type="button" onclick="ipwajax('enabletorch')" value="打开LED"
【问题讨论】:
标签: led flashlight
假设ipwajax('enabletorch') 启用 LED,ipwajax('disabletorch') 禁用它,你会想要类似的东西
<script language="JavaScript">
function enableTorch(milliSeconds) {
ipwajax('enabletorch');
window.setTimeout("ipwajax('disabletorch');",milliSeconds);
}
</script>
<input type="button" onclick="enableTorch(3000);" value="Turn on LED">
【讨论】: