In my React page, I am attempting to create an infinite scroll list of items that starts at the bottom and ends at the top of a div.
While I have been able to achieve circular scrolling, I am struggling with pausing the scroll when the mouse hovers over the items. They continue to scroll despite the hovering.
As someone new to JS, I need help in implementing a feature that will pause the items in their current positions when the mouse hovers over them, and resume scrolling once the mouse leaves.
Here is the JSON dummy data string:
data = [{"item0":10},{"item1":11},{"item2":12},{"item3":13},{"item4":14},{"item5":15},{"item6":16},{"item7":17},{"item8":18},{"item9":19}];
React code:
(Code remains unchanged)
dashBoard.css
.alerts-header {
text-align: center;
font-weight: bold;
margin-bottom: 10px;
}
.alerts-container {
position:relative;
height:100%;
overflow:hidden;
}
(Styles remain unchanged)
.dashboard_alertBarChart {
width: 45%;
background-color: #1eeeee1a;
border-radius: 10px;
margin-top: 1%;
position: relative;
overflow: hidden;
}
Screenshot:
https://i.sstatic.net/oFGqo.png
I have attempted some solutions but require assistance in halting the scrolling effect when the mouse hovers over the items.
Thank you for your help.