How to replicate 'stepless' scrolling on mousedown of non button element?
See original GitHub issueHello,
I want to achieve the stepless
scrolling behaviour that occurs when holding down an up or down button, but on non button elements, eg something like:
$(document).on("mousedown", ".up", function() {
$('#scrollable_content').mCustomScrollbar('scrollTo','+=100');
});
$(document).on("mousedown", ".down", function() {
$('#scrollable_content').mCustomScrollbar('scrollTo','-=100');
});
This issue (https://github.com/malihu/malihu-custom-scrollbar-plugin/issues/248) provides a solution to achieve it when scrollbuttons has enable
: true
.
But how do I achieve this behaviour when scrollbuttons are not enabled?
The desired behaviour is like that achieved with the following settings:
scrollButtons:{
enable: true,
scrollType:"stepless",
scrollAmount:"auto"
}
Thank You.
Issue Analytics
- State:
- Created 9 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
How to scroll div continuously on mousedown event?
How to continuously scroll '#items' until user releases the button? I tried using jquery mousedown event and animate function but couldn't make it...
Read more >Element.scroll() - Web APIs - MDN Web Docs
Chrome Edge
scroll Full support. Chrome61. Toggle history Full support. Edge79. T...
options.behavior parameter Full support. Chrome61. Toggle history Full support. Edge79. T...
options.left parameter Full...
Read more >Smooth Scrolling | CSS-Tricks
Accessibility of Smooth Scrolling The page may scroll, but the scrolling is a side effect of the focus changing. If you override the...
Read more >Creating Custom Scrollbars with React - This Dot Labs
The scrollbar div will contain a button to scroll up, the elements of the thumb and track inside a wrapper div , and...
Read more >Introduction to browser events - The Modern JavaScript Tutorial
An event is a signal that something has happened. All DOM nodes generate such signals (but events are not limited to DOM).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi,
You can do it with some extra jquery code. I’m posting a (working) code example below (it’s a bit compact but commented)
Hope this helps
@malihu https://github.com/malihu/malihu-custom-scrollbar-plugin/issues/259#issuecomment-74359461
how to make it scrollType:“stepped” like this example to custom next prev arrows?