在 React DOM 中如何实现这个 html.style.overflow = "scroll"; ?问题是我无法定位 html

问题描述 投票:0回答:0

` 常量滚动 = (e) => { | A 列 | B 栏 | | ------ | ------ | |单元格 1 |单元格 2 | |单元格 3 |单元格 4 |

`var currentDiv = e.target;`
`var nextDiv = currentDiv;`

`while(currentDiv.classList.item(0) != "showGrids"){`
`  currentDiv = currentDiv.parentNode;`
`}`
`  if (e.deltaY < 0) {`
`    if (currentDiv.previousElementSibling) {`
`      nextDiv = currentDiv.previousElementSibling;`
`      currentDiv.style.display = "none";`
`      nextDiv.style.display = "grid";`
`    }

    
}else{
 
if(currentDiv.nextElementSibling){
 
nextDiv = currentDiv.nextElementSibling;
 
currentDiv.style.display = "none";
 
nextDiv.style.display = "grid ";
 
}else{
 
console.log("no more slides, changle html overflow to scroll");
 
HOW TO TARGET HTML CHANE ITS STYLE
 
}
 
}
 
}`

 html.style.overflow = "scroll";

javascript reactjs dom
© www.soinside.com 2019 - 2024. All rights reserved.