我有下面的代码,每次点击按钮时打开我的手机LED闪光灯,但我也需要LED在3秒后自动关闭。不知道该怎么做,请帮帮忙。
input type="button“onclick="ipwajax('enabletorch')”value=“打开type=”
发布于 2013-02-07 19:26:26
假设ipwajax('enabletorch')启用了发光二极管,而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">https://stackoverflow.com/questions/14749893
复制相似问题