• Resolved tingytong

    (@tingytong)


    Hi All,

    I am making a one page website, sort of…and I want smooth scrolling to happen on the front page. I know there are a million plugins for this, but I’m not sure they are appropriate for my situation.

    My navigation was created by me creating a new page each time and calling each page “Home” “About” “Blog” etc…

    Then, in my page-home.php file I hard coded a lot of each of these sections that were outlined in my navigation. That is, the “About” and the “Contact” and the summary of the “Blog” page is all on the home page-a one pager.

    Now I want my navigation to smooth scroll to this sections on the front page. So I figured out that if I go to Appearance–>Menu and add a Link to the menu I can connect this to each section by adding #contact, #about or #blog to each section and adding an appropriate anchor to each section in my code.

    What I can’t figure out now is how to get this to smooth scroll.

    I’m new to this, can someone please give me some easy instructions?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Peninah

    (@highlight_creative)

    Try this: https://css-tricks.com/snippets/jquery/smooth-scrolling/

    If that doesn’t work for you, search “jquery smooth scroll tutorial” or “jquery smooth scroll for wordpress tutorial” and see if something else is easier to follow.

    Thread Starter tingytong

    (@tingytong)

    Thanks Peninah. I ended up using another smooth scroll jQuery code. I put the jQuery cdn in the header.php in the head section and then on the page that I wanted smooth scrolling to happen I entered script tags and in between these tags I pasted the smooth scroll jQuery code. This worked!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Smooth scroll’ is closed to new replies.