62,046
社区成员
发帖
与我相关
我的任务
分享
<asp:TemplateField HeaderText="圖案依據">
<ItemTemplate>
<div>
<asp:Image ID="image" Height="30" Width="50" ImageUrl='<%#Eval("bugimage") %>' runat="server" AlternateText="預覽" />
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:GridView ID="GridView1" runat="server">
<Columns>
<asp:TemplateField HeaderText="圖案依據">
<ItemTemplate>
<div>
<asp:Image ID="image" Height="30" Width="50" ImageUrl='<%#Eval("bugimage") %>' runat="server" AlternateText="預覽" />
</div>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<script language="javascript" type="text/javascript" src="jquery-1.3.2.js">
这样?
$(document).ready(function(){
$(".tip").hover(function(e){
$("#box").css("display","block");
$("#box").html("<img style=\"border:0px;width:300px;height:300px;\" src='http://192.168.0.80"+$(this).attr("tips")+"' />");
e=e||window.event;
var x = e.pageX;
var y = e.pageY;
var w = $("#box").width();
var h = $("#box").height();
var resultY = y+10+"px";
if(y+h>$(window).height()){
resultY = y-h-10+"px";
}
$("#box").css({"left":x,"top":resultY});
},function(){
$("#box").css("display","none");
})
})
<div id="box" style="position:absolute;display:none;"></div>