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

How to set an ending point to the data-lax-translatex scroll effect? #74

Closed
EllieMaffio93 opened this issue Dec 17, 2019 · 5 comments
Closed

Comments

@EllieMaffio93
Copy link

I'm trying to set scroll effects using the lax library.

Here's my code:

<div class="coenter code herentainer-fluid outer">
    <div class="container-fluid inner" style="background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.17690826330532217) 50%, rgba(255,255,255,1) 94%), url(<?php echo get_field('block_6_background'); ?>) no-repeat;" />
    <div class="row h-100">
        <div class="col-md-12  align-self-center">
            <div class="container lax" data-lax-translate-x="vh 0, -elh (vw*0.4)" data-lax-anchor="self">
                <h1 class="text-white"><?php the_field('title_block_6'); ?></h1>
                <h2 class="text-white"><?php the_field('subtitle_block_6'); ?></h2>
            </div>
        </div>
    </div>
</div>

Is there a way to make the scroll effect inside .container .lax end just where the .container .lax itself ends?
Right now the h1 and h2 scroll until the end of the container-fluid, and that's not what I want!
I've been able to set the starting point of the scroll effect modifying the data-lax-translate-x="vh 0", but I can't make it end where I want!

Thanks for your help!

@alexfoxy
Copy link
Owner

hey :) Can you put your code into a code pen so I can see the effect your trying to achieve?

@EllieMaffio93
Copy link
Author

Hey Alex! Thanks for you reply! :)
here's my code pen: https://codepen.io/EllieMaffio93/pen/oNgBryy

I'd like both my h1 and h2 end just where the .container .lax itself ends.
Hope it helps you help me! :)

@alexfoxy
Copy link
Owner

Thanks for the demo, what do you mean by "end just where the .container .lax itself ends" ?

I'm not quite sure the effect you're trying to achieve !

@EllieMaffio93
Copy link
Author

Sorry, I'm so new to this, I can't even explain myself :/
Anyway what I mean is that I'd like h1 and h2 to move within the .container .lax's margins and then stop. What I don't want is for both h1 and h2 to move all way out of the screen and disappear.

Thank you so much for your patience! :)

@alexfoxy
Copy link
Owner

Try removing the class .col-md-12 and playing with the lax values. I'm sure you'll get there :)

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

2 participants