我需要将客户端 onLoad
事件与 ASP.Net Image 控件绑定(bind)。我已经尝试了一段时间,但没有成功。
函数名称onload="onLoadFunction(this)"
脚本:
function onLoadFunction(img) {
$(img).css("visibility", "visible"); // Using jQuery
// img.style.visibility = "visible"; // Using just javascript.
}
标记:
<asp:Image ID="imgTopFourImg2" runat="server" width="170px" height="112px" CssClass="ArticleImgHP" border="0" ImageUrl="hello.jpg" OnLoad="onLoadFunction(this)" />
这对我不起作用,如果有人可以帮助我,我将不胜感激。
最佳答案
$("img #xyz").bind("load", function () { $(this).css("visibility", "visible"); });
关于c# - 图像控件的 OnLoad 客户端事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10229625/