我正在尝试使用jQuery来显示我设置为显示的图像:none。我运行代码服务器端,但在页面呈现后看不到图像。有人可以告诉我我需要修改我的代码以显示最初设置为显示的图像:无?我正在尝试显示许多图标,因此我尝试使用jQuery的class属性来执行此操作。如果重要,我正在使用母版页。
服务器端代码:
Page.ClientScript.RegisterStartupScript(typeof(Page), "showEditIcons", "$('.editIcon').css('display', 'block';", true);
HTML:
img id="describeProcessQ" src="assets/images/edit_icon.gif" class="editIcon" style="display: none;" alt="Describe process comments" />
答案 0 :(得分:0)
请尝试使用$('.editIcon').show();
来显示图片。
答案 1 :(得分:0)
Page.ClientScript.RegisterStartupScript(typeof(Page), "showEditIcons", "$(function(){$('.editIcon').show() });