禁用链接 <a>

pointer-events

Syntax

 1 /* Keyword values */
 2 pointer-events: auto;
 3 pointer-events: none;
 4 pointer-events: visiblePainted;
 5 pointer-events: visibleFill;
 6 pointer-events: visibleStroke;
 7 pointer-events: visible;
 8 pointer-events: painted;
 9 pointer-events: fill;
10 pointer-events: stroke;
11 pointer-events: all;
12 
13 /* Global values */
14 pointer-events: inherit;
15 pointer-events: initial;
16 pointer-events: unset;

Example

1 <a href="link.html" class="not-active">Link</a>
2 
3 .not-active {
4    pointer-events: none;
5    cursor: default;
6   opacity: 0.6;
7 }

jQuery Example

1 // disable button
2 $("#myLink").css({ 'pointer-events': 'none' });
3 // enable it again
4 $("#myLink").css({ 'pointer-events': '' });

Bootstrap Disabled Link

1  <a href="#" class="btn btn-primary btn-lg disabled" role="button">Primary link</a>
2  <a href="#" class="btn btn-default btn-lg disabled" role="button">Link</a>

相关:

Disabled Buttons

1 <style>
2 .disabled {
3     opacity: 0.6;
4     cursor: not-allowed;
5 }
6 </style>
原文地址:https://www.cnblogs.com/hzj680539/p/5073648.html