I have 4 links in my page(.phtml file) as follows
<ul id="fileMenu" class="contextMenu">
<li class="add"><a id ="addbtn" href="#add" style="display:none;">Add</a></li>
<li class="download"><a href="#download">Download</a></li>
<li class="rename"><a href="#rename">Rename</a></li>
<li class="del"><a href="#delete">Delete</a></li>
<li class="copypath"><a href="#copypath">Copypath</a></li>
</ul>
I want to disable the add,rename and delete links Just disable it from UI .
User should be able to see it but no click event should be performed(linksshould be grayed out) .
I have used
disable="disabled"
display =none;
but they are not serving the purpose.
Any other way this would work out ?
I would use this CSS to visually disable a link:
Then in order to disable a link you would put a class
disable
on correspondingli
:What it does is basically overlays a link with transparent pseudo element
:before
.Another solution could be using
pointer-events: none
rule but it's not well supported in IE.Demo: http://jsfiddle.net/LPz2Z/1/