js给所有td加上悬浮显示(title)

来源:互联网 发布:sql server win7 编辑:程序博客网 时间:2024/06/13 04:40

更详细的博客转移到了我的github+hexo博客:https://zc95.github.io

//给所有的td加title        function titleAllTd() {            $("#ChaKanGrid tr td").each(function () {                $(this).attr("title", $(this).text());                $(this).css("cursor", 'pointer');            });        }


由于动态加载表格的缘故,有时候表格还没加载出来就调用这个方法的时候是无效的,我表格用的bootgrid

只需这样写就写

.on("loaded.rs.jquery.bootgrid", function (e, columns, row) {        titleAllTd();    });
表格加载完毕加载。


当然你也可以延迟个半秒一秒执行啥的 给数据加载一些时间、、、、、