Open the top navigation menu in a new window using jQuery in SharePoint

This SharePoint tutorial explains, how to open the top navigation menu in a new window using jQuery.

SharePoint 2013 has new feature Navigation using Managed Metadata which is pretty cool. Top Navigation managed metadata menu doesn’t have the option to open the links in a new window.

Below jquery code will allow the links to be opened in a new window. Place the code inside .js file and provide the reference in the master page.

$(document).ready(function ()
{
$('.ms-acal-apanel-title > img').unwrap();
$('.ms-acal-apanel-title > span').css('color', '#666');
$('.menu-item').each(function(){

$(this).closest('a').attr('target', '_blank');

});
$('.ms-core-listMenu-verticalBox .menu-item-text').each(function () {
$(this).closest('a').attr('target', '_self');
});

You may like following SharePoint tutorials:

This SharePoint tutorial explains, how to open the top navigation menu in a new window using jQuery.

Donwload Hub site pdf

Download SharePoint Online Tutorial PDF FREE!

Get update on Webinars, video tutorials, training courses etc.

Sambita Rath

I have 9 years of exprience into SharePoint implementation, architecture, Administrator, development and Training.Designing Information Architecture in SharePoint 2007, 2010,2013 and Office 365.

>