【问题标题】:GWT TabLayoutPanel not allow text selection on tabsGWT TabLayoutPanel 不允许在选项卡上选择文本
【发布时间】:2015-05-29 16:53:47
【问题描述】:

您好,有没有办法不允许在 GWT TabLayoutPanel(和其他 gwt 小部件)的选项卡上选择文本?

我尝试使用 css 之类的:

.gwt-TabLayoutPanel {
    user-select: none;
}

.gwt-TabLayoutPanel .gwt-TabLayoutPanelTabs {
    user-select: none;
}
.gwt-TabLayoutPanel .gwt-TabLayoutPanelContent {
    user-select: none;
} 

.gwt-TabLayoutPanel .gwt-TabLayoutPanelTab {
    user-select: none;
} 

.gwt-TabLayoutPanel .gwt-TabLayoutPanelTab-selected {
    user-select: none;
}

谢谢!

【问题讨论】:

  • 在 gwt-TabLayoutPanelTabInner 上试试这个值:-webkit-user-select: none; /* Chrome all / Safari all / -moz-user-select: none; / 火狐全部 / -ms-user-select: none; / IE 10+ / / 尚不支持这些,使用风险自负 */ -o-user-select: none;用户选择:无;
  • 是的,就是这样!谢谢,我从 Tobika 的回答中得知

标签: css gwt gwt-tablayoutpanel


【解决方案1】:

这已经回答了:look here

-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;

对于 IE

<div id="foo" unselectable="on">...</div>

【讨论】:

  • 谢谢,这回答了我,我只是把 user-select: none;
  • 我看过其他部分,比如 -webkit-touch-callout: none;但我没有意识到它们也是必需的。谢谢!
猜你喜欢
  • 2011-07-04
  • 1970-01-01
  • 2011-09-25
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多