Remove menu link root slash on homepage

$(document).ready(function() {

//Remove root slash on menu links on homepage (no refresh)
$(".cmsHomePage #menu a").each(function(){target=$(this).attr("href"),-1===target.indexOf("#")||$(this).attr("href",$(this).attr("href").substring(1))});

});

Old code with JS slide kept for ref

//HOMEPAGE SLIDE TO MENU LINK ID (not active, change .homepage to .cmsHomePage)

$('.homepage #menu a[href*="#"]:not([href="#"])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash)
target = target.length ? target : $('[name=' + this.hash.slice(1) +']')
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});

Index Previous Next