Pop up image on mouse hover

↘锁芯ラ 提交于 2019-12-11 05:54:55

问题


I am using asp.net 2.0 and c#.

I have a datagrid in which I have a image control, i.e.

<asp:Image ID="ImagePreview" runat="server"  Width="62px" Height="62px" />

for which I am setting the image URL from code behind, i.e.the image exist in the physical folder. I want to open a pop up with the image on mousehover.

Please help me. Thanks in advance.

Kindly let me know if any other information is required.


回答1:


Please use JavaScript for this:

ImagePreview.Attributes.Item("onMouseOver") = "javascript:window.open('localhost','newWindow','width=200,height=200')";



回答2:


Try jQuery Tooltips, you can put the image preview in the tooltip. http://flowplayer.org/tools/tooltip/index.html

I've implemented this in a column in a GridView control and it works great



来源:https://stackoverflow.com/questions/3229134/pop-up-image-on-mouse-hover

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!