Hello everybody i have a question i'm on reactjs i did create a class named Storymap and then i created a function that scrolls 2 divs at the same time
for example and the scroll is in the bot div 'the second div'
Scrolling = () => {
var isSyncingLeftScroll = false,
isSyncingRightScroll = false,
leftDiv = document.getElementById('top'),
rightDiv = document.getElementById('bot');
leftDiv.onscroll = () => {
if (!isSyncingLeftScroll) {
isSyncingRightScroll = true;
rightDiv.scrollLeft = this.scrollLeft;
}
isSyncingLeftScroll = false;
};
rightDiv.onscroll = () => {
if (!isSyncingRightScroll) {
isSyncingLeftScroll = true;
leftDiv.scrollLeft = this.scrollLeft;
}
isSyncingRightScroll = false;
};
}
and i call it like that
<div className="divdeux" id="bot" onScroll={this.Scrolling}>
but it doesn't work !!! for me Thanks to anyone who takes time to review and give feedback.