我想在运行时显示图像标签....... [英] i want to show the image tag in runtime .......
本文介绍了我想在运行时显示图像标签.......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我的html页面中有一个图片标签.
我想动态插入图像,以达到此目的
在设计时,我不会看到图像标记,它应该是不可见的.
请问对我有什么帮助吗?在运行应用程序(HTML页面)之前,如何隐藏图像标签?单击按钮后图像标签应该出现?
预先感谢,
关于,
hi all,
i have a image tag in my html page.
i want to insert a image dynamically , so that purpose
at design time i won''t see the image tag it should be in unvisible.
pls any body help to me how can i hidden the image tag at before running the application(Html page) and after click on the button image tag should appear ?
Thanks in advance,
Regarding ,
推荐答案
首先设置具有空白图像(如1 x 1像素的白色图像)的图像标签.
然后使用Javscript
您需要为此使用javascript:
First set Image Tag with a blank image like 1 x 1 pixel white image.
Then use Javscript
You''ll need to use javascript for this:
<img src="white.jpg" id="RunTimemage" />
<script type="text/javascript">
document.getElementById("RunTimeImage").src = "image3.jpg";
</script>
如果需要,您也可以切换其可见性:
声明它不可见.
Also you can toggle its visibility too if you want:
Declare it invisible.
<img src="" style="visibility:hidden"></img>
使其可见:
Make it visible:
document.getElementById(RunTimeImage).style.visibility = 'hidden';
这篇关于我想在运行时显示图像标签.......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文