smooth scrolling

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #10038069
    Jadus
    Participant

    Hi, I’m using sections of several different versions of Porto. The header portion is from demo-hotel but I’m using the code from demo-barber for the main nav in order to get smooth scrolling.

    The links are like this: <a class="dropdown-item" data-hash data-hash-offset="98" href="#gallery"> Gallery</a>

    Changing the offset number doesn’t work to get the scroll to go to the correct location on all sections. Some it does, some it doesn’t do anything. Can you please tell me what data-hash-offset is? I understand the concept but is it JS or what? I can’t find any documentation on it.

    Thanks



    Template Version: Multiple
    #10038077
    Support
    Keymaster

    Hello, data-hash-offset is used to redirect to the top of the section ID discounting the height of the sticky header, example:

    https://www.okler.net/previews/porto/8.3.0/index-one-page.html

    Let me know if you have any questions.

    Kind Regards,

    Jonas


    #10038080
    Jadus
    Participant

    I understand what data-hash-offset is supposed to do. I was asking what kind of code (I’m fairly new to coding) it is, because it’s not working. On some links, it doesn’t matter what I set the number value to, it still goes to the same spot, not where I want it to. Do you have any idea why it wouldn’t work?


    #10038082
    Support
    Keymaster

    Hi,

    That is a customized code we created for Porto, you can find it on file js/theme.js ( look for $(‘[data-hash]’) .

    If possible please send us a message with the URL of your site so we can check what is going on.

    Thanks!

    Jonas


    #10038104
    Jadus
    Participant
    This reply has been marked as private.
    #10038109
    Support
    Keymaster
    This reply has been marked as private.
Viewing 6 posts - 1 through 6 (of 6 total)

This topic is marked as "RESOLVED" and can not rceive new replies.