防止文本表高亮显示 [英] Prevent Highlight of Text Table

查看:98
本文介绍了防止文本表高亮显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一张桌子,我允许用户'选择'多行。这一切都使用jQuery事件和一些CSS来处理,以直观地指示该行是被选中的。当用户按下shift键时,可以选择多行。有时这会导致文字突出显示。无论如何要防止这一点?

I have a table, and I'm allowing users to 'select' multiple rows. This is all handled using jQuery events and some CSS to visually indicate the row is 'selected'. When the user presses shift, it is possible to select multiple rows. Sometimes this cause text to become highlighted. Is there anyway to prevent this?

推荐答案

有一个CSS3属性。

There is a CSS3 property for that.

#yourTable {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

这篇关于防止文本表高亮显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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