Link to home onepage from subpage error

3 replies · opened Nov 6, 2018

HHamarJNov 6, 2018

Hi,

I use onepage navigation in my main page but I also use subpages. I want to link to a section of main page from a subpage.

I used this script from this topic but my link not working: http://support.semicolonweb.com/forums/topic/link-to-home-onepage-section-from-subpage/

<script>
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);
    }
});

</script>

My subpage is: https://678.hu/isec/documents.html
The main page is: https://678.hu/isec

Thanks,

Janos

SSemicolon WebSTAFFNov 8, 2018

Hello,

Please change $('html,body').stop(true).animate to jQuery('html,body').stop(true).animate .

This should fix the issue. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

HHamarJNov 10, 2018

It helped. Thanks!

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