Closed talon-himself closed 7 years ago
You can create "after" and "before" scrolled callbacks.
See the API: https://github.com/bySabi/react-scrollchor#before-and-after-animate-callbacks
Awesome, thank you for the quick reply. Are there any examples of this being used?
Take a look a this code: https://github.com/bySabi/react-scrollchor/blob/example/src/App.js#L15 Is the source of:
In this concrete example Sequentially
component get refreshed every 1000 ms. You can see that state
is set inside _afterAnimate callback function with this._iterator.next().value
, iterator is just a helper function that pick a element from an array, ["one", "two", "three"], in a circular way.
I hope this example can illustrate you. Clone the example repo and play with it.
Feel free to ask anything you need.
Okay I will look it over, I don't want to click a section and scroll back, I just want to be able to highlight/bold the Scrollchor tag element in my navbar when the user is on that section of the page.
I see what you want.
Well react-scrollchor
don't handle onMouseEnter
, onMouseLeave
, on Focus
, ...
events by it self. You must provided it
See this stackoverflow thread: https://stackoverflow.com/questions/28365233/inline-css-styles-in-react-how-to-implement-ahover
This kinds of behaviour must be handled at navigation
components levels using, for example, https://react-bootstrap.github.io/components.html#navigation or similar. But of course you can do it by scratch
I will close this for now.
Feel free to reopen is needed.
Does this support some sort of scrollspy?
What I mean is that once you scroll over/click to scroll to , is highlighted/bold.