JS实现图片加载模糊到清晰

xiaoxiao2021-02-28  133

原理:大图加载完成覆盖小图放大图。

<img src="img-small.jpg"  width="960" height="1200" id="myImage"  />

<script language="JavaScript" type="text/javascript"> var img = new Image(); img.src = "img-big.jpg";     img.onload = function() { document.getElementById('myImage').src = this.src;     } </script>
转载请注明原文地址: https://www.6miu.com/read-20691.html

最新回复(0)