Hi guys,
I’m quite new to Wix.
I have been trying to add lock scrolling function in my free Wix website.
But I notice HTML and CSS customization isn’t available in free Wix website.
So, I tried to search some packages in NPM package.
I found no-scroll NPM package.
Here is my code.
import scroll from "no-scroll";
// According to its documentation
const noScroll = require('no-scroll');
$w.onReady(function () {
noScroll.on();
})
The scroll should be locked after the page loads.
But it isn’t working.
Can you guys suggest me another way to lock scrolling or correct me where I went wrong?
Hi! It looks like you are trying to use the no-scroll package in a Wix website, but it seems that the package is not designed to work with Wix specifically. Additionally, it seems that you are trying to use a mix of JavaScript import syntax and CommonJS require syntax in your code, which may be causing issues. One option you could try is to include the no-scroll package as a script in your Wix website using the Wix HTML widget.