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.

2
  • 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, 2013 at 12:53
  • Because that link has no content but other links are coming under it have. This is client requirement. Nov 18, 2013 at 12:57

2 Answers 2

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");
});
0

Instead of adding a link add a label

enter image description here

3
  • Your Answer fits for SharePoint Online/Modern Experience. The Question was for SharePoint 2013 which has no Modern Experience.
    – PhilFancy
    Jul 15, 2020 at 11:15
  • Sorry, I ended up here by searching for this also, so I thought others could end up here also
    – keytrap
    Jul 15, 2020 at 13:04
  • Welcome Ask a similar question relevant and then answer it yourself, that way it can benefit others without adding confusion original question Jul 15, 2020 at 14:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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