Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

horizontal scroll onclick react

const scroll = (scrollOffset) => {
  ref.current.scrollLeft += scrollOffset;
};

 <Row>
        <Col>
          <button onClick={() => scroll(-20)}>LEFT</button>
          <button onClick={() => scroll(20)}>RIGHT</button>
        </Col>
 </Row>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #horizontal #scroll #onclick #react
ADD COMMENT
Topic
Name
2+4 =