alvarotrigo / react-fullpage

Official React.js wrapper for fullPage.js https://alvarotrigo.com/react-fullpage/
GNU General Public License v3.0
1.29k stars 178 forks source link

About fullpage_api.moveTo #395

Closed Seol827 closed 1 year ago

Seol827 commented 1 year ago

Description

I wonder if I can use "moveTo" as a click event for Div outside the . If not, Are there some ways to apply "moveTo" script (for moving top)?

code

      <div onClick={} />     //this is for click event <div>
        <ReactFullpage
          pluginWrapper={pluginWrapper}
          licenseKey={''}
          scrollingSpeed={1000}
          controlArrows={false}
          navigation={true}
          slidesNavigation={true}
          // scrollOverflow={true}
          scrollOverflow={false}

          render={({ state, fullpageApi }) => {
            return (
              <ReactFullpage.Wrapper>
                <div className="section">
                   ...
              </ReactFullpage.Wrapper>

Versions

React / Next.js / Typescript fullPage.js => v4 extensions => v3 @fullpage/react-fullpage => v0.1.33

alvarotrigo commented 1 year ago

Try using the window object:

window.fullpage_api.moveTo(1)
Seol827 commented 1 year ago

@alvarotrigo Thanks so much!! it works!🤩