html中通过js进行预加载图片的问题
请问一下这个大图片我通过setAttribute("src","...");之后出来的图片是模糊的,我要怎样做才能使得图片不是模糊的啊?<divid="picture">...
请问一下这个大图片我通过setAttribute("src","...");之后出来的图片是模糊的,我要怎样做才能使得图片不是模糊的啊?<div id="picture"> <img src="E:\天猫前端\image\8619.jpg" id="img"> </div> <div id="pictures"> <span><img src="E:\天猫前端\image\8620.jpg" class="leftPicture"></span> <span><img src="E:\天猫前端\image\8619.jpg" class="leftPicture"></span> <span><img src="E:\天猫前端\image\8616.jpg" class="leftPicture"></span> <span><img src="E:\天猫前端\image\8617.jpg" class="leftPicture"></span> <span><img src="E:\天猫前端\image\8618.jpg" class="leftPicture"></span> </div>这是javascript代码:var leftPicture = document.getElementsByClassName("leftPicture");var img = document.getElementById("img");leftPicture[1].onmouseover = function(){ img.setAttribute("src","E:/天猫前端/image/8620.jpg"); img.style.width = "360px"; img.style.height = "360px";}
展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询