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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

there is data-scroll-direction attribute missing in the attribute section of locomotive v5 beta #533

Open
asynchronousJavascriptor opened this issue Nov 24, 2023 · 5 comments
Labels

Comments

@asynchronousJavascriptor
Copy link

asynchronousJavascriptor commented Nov 24, 2023

Hello 馃憢

Describe the bug
I was trying a horizontal scroll on a div and found out there is data-scroll-direction is missing in the docs.

To Reproduce
Steps to reproduce the behavior:

  1. Go to attributes
  2. there is not data-scroll-direction available.

Thank you 馃憡

@MontroseSt
Copy link

As per documentation:

Horizontal styles

If you are utilizing the horizontal feature, we recommend applying the following CSS rules:

/* Only necessary with horizontal scrolling */
html[data-scroll-orientation="horizontal"] {
body {
width: fit-content;
}
[data-scroll-container] {
display: flex;
}
}

@asynchronousJavascriptor
Copy link
Author

asynchronousJavascriptor commented Nov 27, 2023

I have applied css rule and It's still not working I have checked it it's animating tanslate3d second parameter which applies for y value and not x, I also tried data-scroll-direction and data-scroll-orientation attributes with horizontal value, here's the code snippet :

<div data-scroll data-scroll-direction="horizontal" data-scroll-speed="2" className="ss name-container w-full relative flex">
          <motion.div
            animate={{ x: "-100%" }}
            transition={{ duration: 10, ease: "linear", repeat: Infinity }}
            className="aa pointer-events-none name-wrap flex itmes-center will-change-transform"
          >
            <h1
              style={{ fontSize: "max(9em, 15vw)" }}
              className="pointer-events-none text-white flex items-center relative leading-none whitespace-nowrap"
            >
              Harsh Sharma <span className="spacer px-[100px]">-</span>
            </h1>
          </motion.div>
          <motion.div
            animate={{ x: "-100%" }}
            transition={{ duration: 10, ease: "linear", repeat: Infinity }}
            className="aa pointer-events-none name-wrap flex itmes-center will-change-transform"
          >
            <h1
              style={{ fontSize: "max(9em, 15vw)" }}
              className="pointer-events-none text-white flex items-center relative leading-none whitespace-nowrap"
            >
              Harsh Sharma <span className="spacer px-[100px]">-</span>
            </h1>
          </motion.div>
        </div>

@asynchronousJavascriptor
Copy link
Author

Can I expect a reply from somebody, please.

@asynchronousJavascriptor asynchronousJavascriptor changed the title there is data-scroll-direction attribute missing in the attribute section. there is data-scroll-direction attribute missing in the attribute section of locomtive v5 beta Dec 2, 2023
@asynchronousJavascriptor asynchronousJavascriptor changed the title there is data-scroll-direction attribute missing in the attribute section of locomtive v5 beta there is data-scroll-direction attribute missing in the attribute section of locomotive v5 beta Dec 2, 2023
@devenini
Copy link
Member

devenini commented Dec 2, 2023

There is no data-scroll-direction attribute. Are you trying to have only a specific part of your page scroll horizontally? If so, it's not supported out of the box, but you can achieve that with a combination of sticky positioning and utilizing the Progress feature from Locomotive Scroll. Here are a few examples of the Progress feature:

However, if you're attempting to make your entire page scroll horizontally, you can check our documentation and refer to this example. Basically, you need to specify lenisOptions.orientation as horizontal and add the horizontal styles.

@devenini devenini added the v5 label Dec 2, 2023
@muhamedkarajic
Copy link

muhamedkarajic commented Mar 29, 2024

There is no data-scroll-direction attribute. Are you trying to have only a specific part of your page scroll horizontally? If so, it's not supported out of the box, but you can achieve that with a combination of sticky positioning and utilizing the Progress feature from Locomotive Scroll. Here are a few examples of the Progress feature:

However, if you're attempting to make your entire page scroll horizontally, you can check our documentation and refer to this example. Basically, you need to specify lenisOptions.orientation as horizontal and add the horizontal styles.

@devenini will there be one eventually? The examples you linked don't do anything horizonal with the elements at all.

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

No branches or pull requests

4 participants