Created
March 2, 2022 11:45
-
-
Save daybrush/63a56217fed058c34d0b2b95141e6e3e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from "react"; | |
import { useConveyer } from "@egjs/react-conveyer"; | |
export default function HorizontalScroll() { | |
const ref = React.useRef<HTMLDivElement>(); | |
const { | |
isReachStart, | |
isReachEnd, | |
} = useConveyer(ref); | |
return <div className="examples"> | |
<div className="buttons"> | |
<button className="prev" disabled={isReachStart}>Start</button> | |
<button className="next" disabled={isReachEnd}>End</button> | |
</div> | |
<div className="items horizontal" ref={ref}> | |
<div className="item">1</div> | |
<div className="item">2</div> | |
<div className="item">3</div> | |
<div className="item">4</div> | |
<div className="item">5</div> | |
<div className="item">6</div> | |
<div className="item">7</div> | |
<div className="item">8</div> | |
<div className="item">9</div> | |
<div className="item">10</div> | |
</div> | |
</div>; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment