Ukusebenzisana
Iiklasi eziluncedo ezitshintsha indlela abasebenzisi abanxibelelana ngayo nemixholo yewebhusayithi.
Ukukhetha umbhalo
Guqula indlela umxholo okhethwe ngayo xa umsebenzisi esebenzisana nawo.
Lo mhlathi uya kukhethwa ngokupheleleyo xa ucofa ngumsebenzisi.
Lo mhlathi unokuziphatha okukhethiweyo.
Lo mhlathi awuzukukhethwa xa ucofa ngumsebenzisi.
<p class="user-select-all">This paragraph will be entirely selected when clicked by the user.</p>
<p class="user-select-auto">This paragraph has default select behavior.</p>
<p class="user-select-none">This paragraph will not be selectable when clicked by the user.</p>
Iziganeko zesalathi
I- Bootstrap ibonelela .pe-none
kunye .pe-auto
neeklasi ukunqanda okanye ukongeza unxibelelwano lwento.
Eli khonkco alinakucofa.
Le linki inokucofa (oku kukuziphatha okungagqibekanga).
Olu nxulumaniso alunakucofa ngenxa yokuba pointer-events
impahla ifunyenwe kumzali wayo. Nangona kunjalo, eli khonkco lineklasi pe-auto
kwaye linokucofa.
<p><a href="#" class="pe-none" tabindex="-1" aria-disabled="true">This link</a> can not be clicked.</p>
<p><a href="#" class="pe-auto">This link</a> can be clicked (this is default behavior).</p>
<p class="pe-none"><a href="#" tabindex="-1" aria-disabled="true">This link</a> can not be clicked because the <code>pointer-events</code> property is inherited from its parent. However, <a href="#" class="pe-auto">this link</a> has a <code>pe-auto</code> class and can be clicked.</p>
.pe-none
(kunye
pointer-events
nepropathi yeCSS eyibekayo) inqanda kuphela ukusebenzisana ngesalathisi (imouse, i-stylus, touch). Unxulumano kunye nolawulo
.pe-none
, ngokungagqibekanga, lusajongeka kwaye luyasebenza kubasebenzisi bebhodi yezitshixo. Ukuqinisekisa ukuba abathathi nxaxheba ngokupheleleyo nakubasebenzisi bebhodi yezitshixo, unokufuna ukongeza ezinye iimpawu ezinje
tabindex="-1"
(ukubathintela ekufumaneni ugxininiso lwebhodi yezitshixo) kunye
aria-disabled="true"
(ukuhambisa inyani yokuba bakhubazekile ngokusebenzayo kubuchwephesha obuncedisayo), kwaye usebenzise iJavaScript zithintele ngokupheleleyo ekubeni zithathelwe amanyathelo. Kulawulo lwefom, cinga ukusebenzisa
disabled
uphawu loyelelwano lwe-HTML endaweni yoko.
Sass
Utilities API
Izinto zokusebenzisana zibhengezwe kwizinto eziluncedo zethu ze-API kwi scss/_utilities.scss
. Funda indlela yokusebenzisa izinto eziluncedo API.
"user-select": (
property: user-select,
values: all auto none
),
"pointer-events": (
property: pointer-events,
class: pe,
values: none auto,
),