<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>fade</title>
</head>
<body style="background: yellow;">
<div></div>
<script>
var fade = function(node) {
var level = 15;
var step = function() {
var hex = level.toString(16);
node.style.backgroundColor = '#FFFF' + hex + hex;
if (level > 1) {
level -= 1;
setTimeout(step, 100);
}
}
setTimeout(step, 100);
}
fade(document.body);
</script>
</body>
</html>
Fade 的实现
最新推荐文章于 2022-02-25 11:40:09 发布