📄 18-4.html
字号:
<!-- This div is the element we are animating --><div id="urgent"><h1>Red Alert!</h1>The Web server is under attack!</div><!-- This is the animation script for the element --><script> var e = document.getElementById("urgent"); // Get the element objectvar colors = ["white", "yellow", "orange", "red"] // Colors to cycle throughvar nextColor = 0; // Position in the cycle// Evaluate the following expression every 500 milliseconds. // This animates the background color of the DIV element.setInterval("e.style.backgroundColor=colors[nextColor++%colors.length];", 500);</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -