Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve documentation for instances of fixed z-index elements #39

Open
JacobDFrank opened this issue Oct 3, 2018 · 5 comments
Open

Comments

@JacobDFrank
Copy link

Improve documentation for instances of fixed z-index elements in which the top or the bottom of the page. The page could have a navigation bar, etc.

An example of mine that I'd like to write documentation on

<div className={classnames('boundary-element', styles.boundaryElement_positioning)}></div>
        <Header pageName='schedule' />
        <div className={'container'}>
          <div className={''} style={{ overflow: 'scroll' }}>
            <Sticky
              hideOnBoundaryHit={false}
              boundaryElement=".boundary-element"
              bottomOffset={0}
              topOffset={-120}
              stickyStyle={{ transform: 'translateY(120px)' }}
            >
              <div className={'flex gridish-container--complete flex-justify-center '}>
                <MediaQuery minWidth={481}>
                  <a className={styles.button_schedule} href="#friday">friday</a>
                  <a className={classnames(styles.button_schedule, styles.button_schedule__leftSpacing)} href="#saturday">saturday</a>
                  <a className={classnames(styles.button_schedule, styles.button_schedule__leftSpacing)} href="#sunday">sunday</a>
                </MediaQuery>
                <MediaQuery maxWidth={480}>
                  <a className={styles.button_schedule} href="#friday">fri</a>
                  <a className={classnames(styles.button_schedule, styles.button_schedule__leftSpacing)} href="#saturday">sat</a>
                  <a className={classnames(styles.button_schedule, styles.button_schedule__leftSpacing)} href="#sunday">sun</a>
                </MediaQuery>
              </div>
            </Sticky>
          </div>
@seancorgan
Copy link

@alex84G
Copy link

alex84G commented Oct 17, 2019

@JacobDFrank
your example configuration of the sticky component helped me a lot.

Thank you!

@kahlan88
Copy link

kahlan88 commented Apr 9, 2020

I think: "Improve documentation" would be more applicable. I love this package, but have to look into the source code to work out what is what (i.e. boundaryElement).

In your example, @JacobDFrank, what styles do you have set on boundaryElement_positioning? I'm struggling with z-indices and would appreciate if you could help. Also: great idea about adding to the documentation!

@gm0t
Copy link
Owner

gm0t commented Apr 14, 2020

hey @kahlan88 , not sure what is your issue, could you please create an example somewhere?
(for example, feel free to fork this example - https://codesandbox.io/s/react-sticky-el-example-fn0ev )

@kahlan88
Copy link

hey @kahlan88 , not sure what is your issue, could you please create an example somewhere?
(for example, feel free to fork this example - https://codesandbox.io/s/react-sticky-el-example-fn0ev )

Thanks, I worked it out based on this issue and by looking at the source code.

I think boundaryElement needs slightly more info than just that it's a ancestor element for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants