Show anchor in URL


I’m working on a one-page site (, I create some anchors with the menu to scroll automatically down in the page but I can’t see the anchor in the URL.

I also want that the URL change with the anchor when I scroll down the page and I’m in a specific section, is that possible? (example



Hello Simone,

I don’t think that there is an easy way to do it, unfortunately.

Please feel free to ask any other questions that you might have.

Kind Regards, Roman.

Hello, i find a solution, i wrote some lines with jQuery:

/*==== Add span for menu landing ====*/

var anchorText = ["pourqui", "casusage", "apropos", "expertise", "platforme", "contact"];

	for(var i=0; i<6; i++){
		   	var html = "<span href='#"+anchorText[i]+"' class='anchor-menu' id='"+anchorText[i]+"'></span>";


/*==== Show anchor in URL ====*/

jQuery(function () {
    var currentHash = "entry";
    jQuery(document).scroll(function () {
        jQuery('.anchor-menu').each(function () {
            var top = window.pageYOffset;
            var distance = top - jQuery(this).offset().top;
            var hash = jQuery(this).attr('href');

            if (distance < 150 && distance > -150 && currentHash != hash) {
                window.history.pushState("state", "page 1", hash);
                currentHash = hash;


            var height = jQuery(window).scrollTop();
            if (height == 0){ window.history.pushState("state", "page 1", " "); currentHash = "entry" }



Great, and thanks for sharing it!

Kind Regards, Roman.