data-href scroll problem

1 reply · opened Jan 16, 2018

Wweb404Jan 16, 2018

i'm using temp: /HTML/landing-2.html

						
							
- [Home](#header)
							
- [Features](#section-features)
							
- [Pricing](#section-pricing)
							
- [Testimonials](#section-testimonials)
							
- [Specifications](#section-specs)
							
- [Buy Now](#section-buy)
						

it have menu witch scroll for sections, but when i am in different page and i want put link ex. open "Testimonials" and use link like this: /HTML/landing-2.html#section-specs it did not work correctly

SSemicolon WebSTAFFJan 23, 2018

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. Hope this Helps!

Let us know if we can help you with anything else or if you find any 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