8
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【css】要素を選択不可にする

Posted at

jQuery UI 1.9 で .disableSelection() はdeprecated(非推奨)になっている1

だから、CSSで代替する^reference方がいい。

* {
   -ms-user-select: none; /* IE 10+ */
   -moz-user-select: -moz-none;
   -khtml-user-select: none;
   -webkit-user-select: none;
   user-select: none;
}

.selectable {
   -ms-user-select: auto;
   -moz-user-select: auto;
   -khtml-user-select: auto;
   -webkit-user-select: auto;
   user-select: auto;
}

このCSS要素はOpera Mini 以外の主要ブラウザでサポートされているとのこと2

参考と注釈

【jQuery UI】テキストの選択を無効にする(disableSelection) - Qiita

Why is .disableSelection() deprecated? - stack overflow

  1. .disableSelection() - jQuery UI 1.12 API Documentation

  2. Can I use user-select ?

8
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
10

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?