脚本宝典收集整理的这篇文章主要介绍了php – 完全加载后显示图像,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
我说有两张照片
$LQimage = "LQabc.jpg"; $HQimg = "HQabc.jpg";
我怎样才能使它工作?
编辑
随着@codeBox发布的答案,这段代码工作..谢谢:)
<htML> <head> <script tyPE="text/javascript"> function load(){ VAR img = new Image(); var imgurl = 'HQabc.jpg'; img.onload = function(){ // this gets run once the image has finished downloading document.getElementById('pp').src = imgurl; } img.src = imgurl; // this causes the image to get downloaded in the background } </script> </head> <body onload="load()"> <img id="pp" src="LQabc.jpg" width=600/> </body> </html>
function PReLoadImage(){ var img = new Image(); var imgurl = 'HQabc.jpg'; img.onload = function(){ // this gets run once the image has finished downloading document.getElementById('idOfImgElement').src = imgurl; } img.src = imgurl; // this causes the image to get downloaded in the background }
<body onload="preLoadImage()">
以上是脚本宝典为你收集整理的php – 完全加载后显示图像全部内容,希望文章能够帮你解决php – 完全加载后显示图像所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。