如何使用jQuery将表格显示为工具提示? [英] How to show a table as a tooltip using jQuery?

查看:55
本文介绍了如何使用jQuery将表格显示为工具提示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个填充了数据的Gridview,其中一个列包含一个链接按钮(文件列表)。如果我单击Linkbutton(FileList),将触发.net事件,并将调用数据库以检索数据。

I have a Gridview populated with data and one of the column contains a Link Button (File List). If I click on the Linkbutton (FileList) a .net event will be fired and a call will be made to the database to retrieve the data.

如何将HTML表格格式的数据显示为工具提示,如附图所示?我想使用jQuery实现工具提示。

How to show that data in a HTML table format as a tool-tip as shown in the attached picture? I would like to achieve the tooltip using jQuery.

推荐答案

简单示例:

HTML

<a href="">test</a>
<table>
    <tr><td>asdf</td><td>gsdi</td></tr>
    <tr><td>asdf</td><td>gsdi</td></tr>
</table>

JS

$('a').hover(function(ev){
    $('table').stop(true,true).fadeIn(); 
},function(ev){
    $('table').stop(true,true).fadeOut();
}).mousemove(function(ev){
    $('table').css({left:ev.layerX+10,top:ev.layerY+10});
});

CSS

table{
    display:none;
    position:absolute;
}
td{
    border:1px solid red;   
}

小提琴演示

这篇关于如何使用jQuery将表格显示为工具提示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆