Hello everyone!
I have a drop-down menu that are dynamically added through WordPress. It looks like this:
Pictures
Sea
Forest
City
"Sea", "Forest" and "City" is categories with "Pictures" as parent category.
My question is:
How do I make the "Pictures" category unclickable?
I did this with jQuery:
$(document).ready(function(){
//Make parent links unclickable
$(".page-item-3").click(function(){
return false;
});
});
...and this with CSS:
li.page-item-3 a {
cursor:default;
}
.page-item-3 ul li a {
cursor: pointer;
}
Markup looks like this:
<div id="menu" class="jqueryslidemenu">
<ul>
<li class="cat-item cat-item-1 current_page_item"><a href="http://blabla" title="Blabla">Blabla</a></li>
<li class="page_item page-item-2"><a href="http://blabla" title="Blabla">Blabla</a>
<ul>
<li class="page_item page-item-28"><a href="http://blabla" title="Blabla">Blabla</a></li>
<li class="page_item page-item-30"><a href="http://blabla" title="Blabla">Blabla</a></li>
<li class="page_item page-item-39"><a href="http://blabla" title="Blabla">Blabla</a></li>
</ul>
</li>
<li class="page_item page-item-3"><a href="http://blabla" title="Blabla">Blabla</a>
<ul>
<li class="page_item page-item-5"><a href="http://blabla" title="Blabla 1">Blabla 1</a></li>
<li class="page_item page-item-7"><a href="http://blabla" title="Blabla 2">Blabla 2</a></li>
<li class="page_item page-item-9"><a href="http://blabla" title="Blabla 3">Blabla 3</a></li>
<li class="page_item page-item-11"><a href="http://blabla" title="Blabla 4">Blabla 4</a></li>
<li class="page_item page-item-13"><a href="http://blabla" title="Blabla 5">Blabla 5</a></li>
</ul>
</li>
<li class="page_item page-item-15"><a href="http://blabla" title="Blabla">Blabla</a>
<ul>
<li class="page_item page-item-222"><a href="http://blabla" title="Blabla">Blabla</a></li>
<li class="page_item page-item-224"><a href="http://blabla" title="Blabla">Blabla</a></li>
<li class="page_item page-item-226"><a href="http://blabla" title="Blabla">Blabla</a></li>
</ul>
</li>
<li class="page_item page-item-17"><a href="http://Blabla" title="Blabla">Blabla</a></li>
<li class="page_item page-item-36"><a href="http://Blabla" title="Blabla">Blabla</a></li>
</ul>
</div>
This almost works But the jQuery code makes all the drop-down links unclickable too.
It would be great if anyone knows how to remove the status bar url while hover the "Pictures" link. But I don't think that is possible to make in moderns browsers such as Safari och Firefox?
Thanks!