I have a strange issue which I can only replicate on Microsoft browsers (Edge and IE11 tested).
<style>
body {
height: 5000px;
width: 5000px;
}
</style>
<p>Click the button to scroll the document window to 1000 pixels.</p>
<button onclick="scrollWin()">Click me to scroll!</button>
<script>
function scrollWin() {
window.scrollTo({
left: 1000,
top: 1000,
behavior:"smooth"
});
}
</script>
This code correctly scrolls the window 1000px to the left and down, with a smooth behaviour in Chrome and Firefox. However, on Edge and IE, it does not move at all.
Locate your profiles and click on Settings. Uncheck the Make scroll wheel scroll window under cursor option. Some users confirmed this fixed the issue and allowed them to keep using X-Mouse without breaking other mouse capabilities.
Step 1: Type in chrome://flags/#smooth-scrolling in Chrome's address bar and press Enter. Step 2: To turn the feature off, click on the disable link. Then, click on a restart button to complete the process.
You can toggle the settings under “Roll the mouse wheel to scroll” to “One screen at a time” or “Multiple lines at a time”. Open Microsoft Edge. In the address bar type edge://flags. In the search box at the top, type Microsoft Edge scrolling personality.
As mentioned before, the Scroll Behavior specification has only been implemented in Chrome, Firefox and Opera.
Here's a one-liner to detect support for the behavior
property in ScrollOptions
:
const supportsNativeSmoothScroll = 'scrollBehavior' in document.documentElement.style;
And here's a simple implementation for cross-browser smooth scrolling: https://gist.github.com/eyecatchup/d210786daa23fd57db59634dd231f341
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With