提醒图像运行时 [英] alert in the run time of an image
本文介绍了提醒图像运行时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<br />
Account += @"<div class=''header_readcount_float_row_img2'' onclick=""DisplayMessage(''Frm_Phonebook.aspx'',''fffffff'',''Frm_Phonebook.aspx'')"" ><a href=""javascript:void(0)"" > <img src=''images/delete.bmp'' /> </a>";<br />
我想对该图像发出onclick事件警报???????
感谢
i want to make an alert onclick event of that image???????
thanks
推荐答案
以下是在head
标记中找到的javascript代码:
Below is the javascript code found in thehead
tag:
<script type="text/javascript">
function HideDiv()
{
if (document.getElementById)
{ // DOM3 = IE5, NS6
document.getElementById(''myDiv'').style.visibility = ''hidden'';
}
else
{
if (document.layers)
{ // Netscape 4
document.hideShow.visibility = ''hidden'';
}
else
{ // IE 4
document.all.hideShow.style.visibility = ''hidden'';
}
}
}
function ShowDiv()
{
if (document.getElementById)
{ // DOM3 = IE5, NS6
document.getElementById(''myDiv'').style.visibility = ''visible'';
}
else
{
if (document.layers)
{ // Netscape 4
document.hideShow.visibility = ''visible'';
}
else
{ // IE 4
document.all.hideShow.style.visibility = ''visible'';
}
}
}
</script>
以下是在body
标记中找到的html代码:
Below is the html code found in the body
tag:
<img src="C:\myPic.jpg" onclick="ShowDiv()" width="100px" height="100px" />
<div id="myDiv" style="visibility:hidden; background-color:Blue; z-index:100" >
<asp:Label ID="lblQuestion" runat="server" Text="Do you want to delete image?"></asp:Label>
<asp:Button ID="btnYes" runat="server" Text="Yes" OnClick="btnYes_Click" />
<asp:Button ID="btnNo" runat="server" Text="No" OnClientClick="HideDiv()" />
</div>
以下是C#代码:
Below is the C# code:
protected void btnYes_Click(object sender, EventArgs e)
{
System.IO.File.Delete("C:\\myPic.jpg");
}
<img src=''images/delete.bmp'' onclick="alert(''This is an alert box!!'')" />
这篇关于提醒图像运行时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文