layui点击table表格的每一格时显示相应的内容

 1   $(document).on('click','.layui-table-cell',function(){
 2         // $("p").css({"background-color":"blue","font-size":"14px"});
 3        var x=$(this).offset(),
 4            left=x.left,
 5            top=x.top;
 6         var w=$(this).width(),
 7             h=$(this).height();
 8         $('.hoverDiv').css({
 9             "width":w,
10             "left":left+"px",
11             "top":top+h+'px',
12             "display":'block',
13             "background":'pink',
14         }).slideDown();
15     })
原文地址:https://www.cnblogs.com/yangguoe/p/9067433.html