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

Title shifts down #137

Open
UisgeBeatha436 opened this issue Nov 10, 2018 · 1 comment
Open

Title shifts down #137

UisgeBeatha436 opened this issue Nov 10, 2018 · 1 comment

Comments

@UisgeBeatha436
Copy link

UisgeBeatha436 commented Nov 10, 2018

I noticed my title shifts down when using Rellax:
<h1 class="title rellax" data-rellax-speed="-3" style="transform: translate3d(0px, 78px, 0px) translate3d(0px, 0px, 0px);">Downloads</h1>

The 78px seems related to the speed setting, i.e. if I enter a speed of 0, than 0px, when -2 than 52px.

I noticed similair behavior when using a div:

<div class="container rellax" data-rellax-speed="-3" style="transform: translate3d(0px, 42px, 0px) translate3d(0px, 7px, 0px);">
              <h1 class="title">Downloads</h1>
            </div>

My js-script:

<script>
    	var rellax = new Rellax('.rellax', {
        // center: true
        callback: function(position) {
            // callback every position change
            console.log(position);
        }
      });
    </script>
    <script type="text/javascript">
    $(document).ready(function() {
      if ($(window).width() >= 991) {

        setTimeout(function() {
          var rellax = new Rellax('.rellax', {
            center: true
          });
        }, 5000);

        var rellaxHeader = new Rellax('.rellax-header');
        var rellaxText = new Rellax('.rellax-text');
      }

    });
  </script>

Can anyone explain the cause and how to solve it?

@shrpne
Copy link
Contributor

shrpne commented Mar 29, 2019

Well, when you apply rellax to an element, don't you expect it shifting?

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