[Resolved] Smooth Scroll in button

Home Forums Support Smooth Scroll in button

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1052123
    Jesús

    Hello!

    I´m using smooth scroll to menu items with this code:
    <a class="smooth-scroll" href="#my-section">My Section</a>
    where class smooth scroll lets to do scroll to my-section. And menu buttons work well.

    But now, I´ve other buttons which they use a different class:
    <a class="button windows" href="#en-mac">....</a>
    And I want to use the smooth-scroll in this class but I don´t know how I can add smooth-scroll in my class. In other words, I can´t use in my button my own class “button windows” + “smooth-scroll”.

    How can I add smooth-scroll in my class “button windows”?

    I´ve tried this:

    .button.windows,
    .button.windows:visited {
    ...
    ....
    ....
    	scroll-behavior: smooth;<<<<<<<<<===========
    }

    But scroll-behavior doesn´t works 🙁

    Thank you!

    #1052156
    David
    Staff
    Customer Support

    Hi there,

    just add the smooth-scroll class to your button html eg.

    <a class="button windows smooth-scroll" href="#en-mac">

    #1052447
    Jesús

    Thanks for your quick response!

    I have already done it, it works well, but I have a small problem and I hope you understand me (and I can explain myself well :)).

    If you enter my website for the first time (incognito browser) and go to the url where I have indicated in the first message, the scroll works but the h2 title remains hidden.
    If you scroll up on my website and press the button (no menu item, Android button) it works fine.
    I want to say that the first time, the “Take capture on Android” button directs you to the content but the h2 title is hidden, the next times you press the button it does direct you to the h2 title correctly.

    Can you check this please?

    Thank you.

    #1052649
    Jesús

    Hello!

    Sorry! To detect this error was hard. The problem was the plugin WP-Rocket, now, I´ve solved my problem 🙂

    Thanks!!

    #1052660
    David
    Staff
    Customer Support

    Glad to hear you got it resolved.

    #1052664
    Jesús

    Thanks David!!

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.