I need to load a "fake loader" when a menu link is triggered, but in this menu some links are empty <a href="javascript:;">
or <a href="#">
, I need to only identify these via javascript and not open the loader. >
I can not add anything in the menu (id, class, etc ...).
$( "a" ).click(function() {
$( "#loader" ).fadeIn( "slow" );
});
#loader{ width: 100%; height:100%; display: none; background-color:rgba(255,255,255,0.6); position: fixed; top: 0; left: 0; z-index: 2 }
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><divid="loader"><img src="images/loader.gif" width="100px" height="100px" style="margin-left: 45%; margin-top: 20%;" /></div>
<nav>
<ul>
<li><a href="#">Vazio 1</a> <- Não pode Funcionar</li>
<li><a href="javascript:;">Vazio 2</a> <- Não pode Funcionar</li>
<li><a href="linkcerto">Link correto</a></li>
</ul>
</nav>
The reason for the problem is the backend developer of the site I'm messing around with, so I can not manipulate the source code directly, just in java-script.