Link not working in LI
Question by Pjack
OMG I’m pulling my hair out trying to figure out why some links don’t work in the UL. However if your right click open in new tab that works. I don’t understand why some are not clickable. The first two links work but they are events used by jQuery. 3rd and 4th links are actual pages and those don’t work and never does the last javascript/jquery link. Just the first two using jQuery. The others do not. I’ve reformatted my CSS several times and no difference. The unusual tags is because I use Smarty. BTW using Chrome.
This is the HTML
Edit: rendered markup
<div id="phomenu" class="photoMenu">
<ul>
<li><a id="avatar_13885_10028" class="set_avatar" href="#13885">Use This Photo As Avatar</a></li>
<li><a id="cover_13885_10028" class="set_cover" href="#13885">Use This Photo As Album Cover</a></li>
<li><a href="/page-13885-k4cjGSDSG4K.html">Page Photo</a></li>
<li><a href="/?page=photo&section=desc&pho_id=13885">Edit Photo Information</a></li>
<li><a id="remove_k4cjGSDSG4K_13885" class="remove_photo" href="javascript:void(0)">Delete this photo</a></li>
<li><a id="feature_13885" class="feature_photo" href="javascript:void(0)">Feature Photo</a></li>
</ul>
</div>
And this is the CSS
.photoMenu ul{
list-style-type: none;
list-style-position: outside;
margin: 0;
padding: 0;
font-size:9pt;
border-top: 2px solid #ffa449;
}
.photoMenu li {
margin: 0;
}
.photoMenu li a {
color: #FFFFFF;
border-bottom: 1px solid #e6e6e6;
display:block;
min-height:25px;
padding-top:10px;
background-color:#C6711B;
text-decoration: none;
}
.photoMenu li a:hover {
color: #FFF;
background-color: #f2a83a;
}
Answer by Starx
The code you have shown so far does not have any problem. The problem is somewhere else, may be your script is interfering with the link.
If the browser is just made at you, it can get angry with the javascript:void(0)
part
Although unnecessary it may require a ;
at the last
<li><a id="remove_k4cjGSDSG4K_13885" class="remove_photo" href="javascript:void(0);">Delete this photo</a></li>
<li><a id="feature_13885" class="feature_photo" href="javascript:void(0);">Feature Photo</a></li>