Scroll Modes
StringTune offers flexible scroll modes to cater to different devices and user experiences. You can easily switch between these modes to achieve the desired scrolling behavior on your website.
Desktop Mode
By default, StringTune uses a smooth scrolling experience on desktop devices. This mode provides a fluid and engaging user experience, enhancing the overall feel of your website.
To enable smooth scrolling on desktop:
const tune = StringTune.getInstance();
tune.scrollDesktopMode = 'smooth'; // This is the default setting
To disable smooth scrolling on desktop:
const tune = StringTune.getInstance();
tune.scrollDesktopMode = 'disable';
To use the default browser scrolling on desktop:
const tune = StringTune.getInstance();
tune.scrollDesktopMode = 'default';
Mobile Mode
For mobile devices, StringTune defaults to the standard browser scrolling behavior. This ensures optimal compatibility and performance on touchscreens.
To use the default browser scrolling on mobile:
const tune = StringTune.getInstance();
tune.scrollMobileMode = 'default'; // This is the default setting
To disable scrolling on mobile:
const tune = StringTune.getInstance();
tune.scrollMobileMode = 'disable';
Important Notes
- The
scrollMobileModesetting applies to devices with screen widths less than 1024 pixels or those identified as touch devices. - The
scrollDesktopModesetting applies to devices with screen widths greater than or equal to 1024 pixels and those not identified as touch devices. - You can dynamically change the scroll mode based on user interactions or other events.
By customizing the scroll modes, you can fine-tune the user experience on your website, ensuring it is optimized for both desktop and mobile devices.