/    Sign up×
Community /Pin to ProfileBookmark

Back to top/menu jump (not scroll) on Desktop Chromium browsers.

Here’s the official page for a [theme](https://www.indocreativemedia.com/wordpress-theme-demo/simple-flat/)
On mobile, the back to top and menu scroll as expected.
On desktop (for me) in Edge, Chrome, and Opera, it just jumps without scrolling.
In FF it works OK.
Is this a Javascript issue. I’d love to know how to fix it. I don’t want to just use a back to top WP plugin, I’d like to fix or completely change the code that the theme is using. (I’m using a child of the theme.)
Thanks for any advice. I’m used to tinkering with HTML and CSS, but not Javascript at this point.

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@VITSUSAJan 19.2021 — You are on the right way but where are you stuck? Can please share any error message with us.
Copy linkTweet thisAlerts:
@Grant-BarkerauthorJan 20.2021 — I'm not getting any error messages.

I'm using the theme, but when you click the back to top button, it only smooth scrolls to the top in Firefox.

In other browsers, it goes to the top but without scrolling.

Cheers. I'll try to search more.
Copy linkTweet thisAlerts:
@daveyerwinJan 20.2021 — @Grant-Barker#1626915 said ...

On desktop (for me) in Edge, Chrome, and Opera, it just jumps without scrolling.

- - - - - - -
I can not duplicate that problem here

I get smooth scroll with FF Edge and Chrome
Copy linkTweet thisAlerts:
@rpg2009Jan 20.2021 — On your desktop are you using an older version of edge?

I believe the script relies on the css property **scroll-behavior: smooth;**

If you inspect the html tag for that theme sample, you will see scroll-behavior is indeed set to smooth

This is the function being called
``<i>
</i>function simpleflatTopFunction() {
document.body.scrollTop = 0,
document.documentElement.scrollTop = 0
}<i>
</i>
``

These are the supported browsers/versions for smooth scroll

[https://css-tricks.com/almanac/properties/s/scroll-behavior/#browser-support](https://css-tricks.com/almanac/properties/s/scroll-behavior/#browser-support)

Outside of that if you require smooth scroll for older browsers you will need a polyfill
Copy linkTweet thisAlerts:
@ashtewari95Jan 20.2021 — i want to share thread on [Top Real Estate Agent In Brampton](url=https://www.ashtewary.com/).
×

Success!

Help @Grant-Barker spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...