Link to Home Onepage Section from Subpage

3 replies · opened Nov 25, 2016

PphilippdoblhoffNov 25, 2016

Hey,

I use OnePage Navigation on the landing page, but I also use subpages. How do I link to a specific section on the landingpoage from an other subpage (e.g faq)?

I link to faq with php: index.php?page=faq, and then i include faq.php in the content. How can I use the main Onepage Navigation from Landingpage from the subpage "faq"?

Thanks!

SSemicolon WebSTAFFNov 27, 2016

Hello,

Currently, the Scroll to Section functionality is not available from External URLs. However, you can simply add the following JS code at the bottom of the Page just after the js/functions.js JS File Linking to enable this:


    jQuery(document).ready( function(){
        setTimeout(function() {
            if (location.hash) {
                window.scrollTo(0, 0);
            }
        }, 1);
    });

    jQuery(window).on('load', function(){
        var divScrollToAnchor = window.location.hash;

        if( typeof divScrollToAnchor !== 'undefined' ) {
            var t = setTimeout( function(){
                $('html,body').stop(true).animate({
                    'scrollTop': $( divScrollToAnchor ).offset().top - 100
                }, 700, 'easeOutQuad');
            }, 1000);
        }
    });

This will definitely work fine. Let us know if we can help you with anything else or if you find any issues.

PphilippdoblhoffNov 28, 2016

Thanks for reply.

How do I have to link now from an external source or modify the main menu links? Currently I have

[Service](#section-service)

But this works only on the home one page.

[Service](#section-service)

doesnt. work

Thanks in advance!

SSemicolon WebSTAFFNov 28, 2016

Hello,

Please use the following Link Code when using this from an External Page:

[Service](#section-service)

This will definitely work fine. Let us know if we can help you with anything else or if you find any further issues.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard