码迷,mamicode.com
首页 > 其他好文 > 详细

文字过长设置隐藏,鼠标hover时显示在title上

时间:2019-11-13 11:12:57      阅读:427      评论:0      收藏:0      [点我收藏+]

标签:style   flow   bre   his   文字   赋值   hover   css   工作   

         <td>
             <span class="text-content">
                 1.工作内容工作内容工作内容工作内容工作内容工作内容工作内容
                 2.工作内容工作内容工作内容工作内容工作内容工作内容工作内容
              </span>
          </td>

css:
/*表格超出隐藏*/
.ellipsis-table{table-layout:fixed;}
.ellipsis-table td{width:100%;word-break:keep-all;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
js:
//内容赋值title
$(‘.text-content‘).hover(function () {
    var value = $(this).text();
    $(this).attr(‘title‘,value);
});

 

文字过长设置隐藏,鼠标hover时显示在title上

标签:style   flow   bre   his   文字   赋值   hover   css   工作   

原文地址:https://www.cnblogs.com/mahmud/p/11846987.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!