七夕小礼包派送~动态比心
作者:互联网
(效果图)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>xinxin</title>
</head>
<body>
</body>
<script src="../../public.js"></script>
<script>
setInterval(autoPlay, 250);
function autoPlay(){
var img = document.createElement("img");
img.src = "xin.png";
document.body.appendChild(img);
var w = getRand(10,30);
img.style.width = w + "px";
img.style.position = "absolute";
var l = getRand(0,window.innerWidth-w);//距离左边
var t = getRand(0,window.innerHeight-w);//距离上面
img.style.left = l + "px";
img.style.top = t + "px";
}
</script>
</html>
标签:style,img,px,礼包,var,派送,比心,getRand,autoPlay 来源: https://www.cnblogs.com/g-code/p/11315208.html