Use scrollTo in navigation menu

Community Forums Forums General Discussion Use scrollTo in navigation menu

This topic is: not resolved

This topic contains 1 reply, has 2 voices, and was last updated by  Susan 1 year, 7 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #87159


    Good afternoon guys,
    I’m new to the Genesis Framework and have purchased the Agency Pro child theme.

    I’ve created a nav-menu that looks more or less like this:

    <nav class="nav-primary">
    		<li><a href="index.php#about-us">About Us</a></li>
    		<li><a href="index.php#talent">Talent</a></li>
    		<li><a href="index.php#contact">Contact</a></li>
    		<li><a href="blog.php">Blog</a></li>

    On the index.php page (landing page), I want the scrollTo script to kick in, so I need the #id’s to make that work. But I don’t want the browser to reload. To try and dodge that, I created a small jquery script

    /* Adjust scrollTo based on page location
    	-------------------------------------------- */
    	var pathArray =,
    		menuScrollTos = $('a[href*="index.php"]');
    	if(pathArray == "localhost" || pathArray == "") {
    		//rewrite menu item hrefs if page == localhost
    		menuScrollTos.each(function() {
    			//* Rewrite href to just the ID
    			var link = $(this).attr('href'),
    				id = '#' + link.split("#")[1];
    			$(this).attr('href', id);

    Unfortunately the scrollTo script still doesn’t kick in.

    I figure I need the ‘index.php’ before the id or if I’m on the Blog page (blog.php), then the links won’t go anywhere as the id’s won’t exist.

    This is really doing my head in, so it’d be great if someone out there could help out!

    Thanks in advance!



    Did you ever get this figured out? I’d be happy to escalate if you are still looking for resolution.

    Susan @ One Happy Studio I offer theme customizations I tweet!
    I’ve taken up the challenge! – help me answer some of the unanswered posts

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.