<script>
!function() {
var bottom = Math.floor(60 * Math.random()),
right = Math.floor(50 * Math.random()),
rotate = Math.floor(360 * Math.random());
var foolsEgg = document.createElement("img");
foolsEgg.src = "https://search-operate.cdn.bcebos.com/b028c278cbb84660f8bde79d819bc30b.png";
foolsEgg.style.position = "fixed";
foolsEgg.style.bottom = "".concat(bottom, "%");
foolsEgg.style.right = "".concat(right, "%");
foolsEgg.style.zIndex = "9999";
foolsEgg.style.pointerEvents = "none";
foolsEgg.style.width = "40%";
foolsEgg.style.maxWidth = "190px";
foolsEgg.style.transform = "".concat("rotate(", rotate, "deg)");
document.body.append(foolsEgg);
} ();
</script>
页面中引入js通常大家最为熟悉的是一下两种方法:
在页面中直接写入<script type="text/javascript">js代码</script>
在页面中引入外部文件<script src="xx.js"></script>
暂无评论