3

i write a class disabled in li tag show disabled style but click the menu is run

<li class=" disabled"> <a class="ajax-link" href="#"><i class="glyphicon glyphicon-align-justify"></i><span> List Services</span></a></li>

why the menu inactive in class disable any way to disable the menu in this condition ,please help me, thanks in advance

Andrew
  • 840
  • 3
  • 17
  • 43
  • Setting an arbitrary class name to an element doesn't make it unclickable, please show the relevant CSS. And please, clean up the PHP mess from the example, this is a client-side problem. – Teemu Oct 09 '17 at 05:16
  • 1
    Refer https://stackoverflow.com/questions/15643505/how-can-i-disable-a-specific-li-element-inside-a-ul – Jaydeep Rajput Oct 09 '17 at 05:20
  • @jayadeeprajput tkz it's working – Andrew Oct 09 '17 at 05:22

2 Answers2

3

CSS:

.disabled {
    pointer-events:none; //This makes it not clickable
    opacity:0.6;         //This grays it out to look disabled
}

add this to solve that issue !!!

Andrew
  • 840
  • 3
  • 17
  • 43
2

The element is never the target of mouse events; however, mouse events may target its descendant elements if those descendants have pointer-events set to some other value.

Use this code:

.disabled a {
   pointer-events:none; 
   opacity:0.6;
}
Sereda
  • 21
  • 2