【发布时间】:2016-01-22 19:41:24
【问题描述】:
我在 asp.net gridview 中使用了 img src,它从 DB 加载图像并且它可以工作,但问题是我希望在单击时在屏幕上显得更大,但我无法实现。我写了一个代码来缩放gridview内的图像,但我不想要那样,我想让它在gridview之外显得更大。
<asp:TemplateField HeaderText="Letter Copy">
<ItemTemplate>
<img src='../SiteImages/<%# Eval("OutgoingLetterCopy") %>' width="20" height="20"
onmouseover="ShowFull(this)" onmouseout="ShowActual(this)" />
<%--<asp:ImageButton ID="btnOutgoingLetterCopy" runat="server" ImageUrl='../SiteImages/<%# Eval("OutgoingLetterCopy") %>' CommandArgument='<%# Container.DataItemIndex %>' ControlStyle-Width="20px" ControlStyle-Height="20px" />--%>
</ItemTemplate>
</asp:TemplateField>
代码:
function ShowFull(ctrl) {
ctrl.style.height = '280px';
ctrl.style.width = '280px';
}
function ShowActual(ctrl) {
ctrl.style.height = '20px';
ctrl.style.width = '20px';
}
【问题讨论】:
标签: javascript jquery asp.net jquery-ui gridview