0

In my top navigation there are several links which are basically subsites. Under subsites are further sites or pages. I am using SharePoint 2013 default top navigation in my custom master page. I got its code from "Design Manager".

There is a particular top level subsite which I want to make unclickable. For e.g. currently this is the top navigation.

Home
Subsite1
Subsite2
Subsite3
Subsite4
Subsite5

I want to make Subsite1 unclickable so is there a way to put a # in its URL so when user clicks it, nothing happen.

  • That would confuse users, I'm sure. Why would you like to make a LINK not clickable? Isn't it better to hide it altogether? I'm just curious. – Benny Skogberg Nov 18 '13 at 12:53
  • Because that link has no content but other links are coming under it have. This is client requirement. – Frank Martin Nov 18 '13 at 12:57
1

You could achieve that using jQuery. Get the first link of the dropdown menu and set the href of that link.

$(function() {
    $("#DeltaTopNavigation > div > ul > li > ul > li > ul > li > a:first").attr("href", "#");
});

If you want the link to be completely unclickable, then you could also remove its attribute.

$(function() {
    $("#DeltaTopNavigation > div > ul > li > ul > li > ul > li > a:first").removeAttr("href");
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.