鼠標(biāo)禁用樣式:cursor: not-allowed;
鼠標(biāo)禁用事件:pointer-events: none;
元素永遠(yuǎn)不會(huì)成為鼠標(biāo)事件的target。但是,當(dāng)其后代元素的pointer-events屬性指定其他值時(shí),鼠標(biāo)事件可以指向其后代元素。
如果同時(shí)使用 ,鼠標(biāo)為默認(rèn)樣式;
cursor: not-allowed;(cursor:no-drop)
pointer-events: none;
解決方法:
-
外層添加盒子將樣式分開
外部盒子使用cursor: not-allowed;(cursor:no-drop)
內(nèi)部盒子使用pointer-events: none;文章來源:http://www.zghlxwxcb.cn/news/detail-545348.html
-
不使用鼠標(biāo)禁用事件,而是在鼠標(biāo)點(diǎn)擊事件中做判斷文章來源地址http://www.zghlxwxcb.cn/news/detail-545348.html
到了這里,關(guān)于鼠標(biāo)禁用樣式(cursor: not-allowed)無效和鼠標(biāo)禁用事件(pointer-events: none)沖突的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!