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

Negative translations not working? #12

Closed
bluantinoo opened this issue Nov 24, 2016 · 1 comment
Closed

Negative translations not working? #12

bluantinoo opened this issue Nov 24, 2016 · 1 comment

Comments

@bluantinoo
Copy link

bluantinoo commented Nov 24, 2016

I can't manage to make elements move in the opposite direction of mouse.

I made a custom position, like this one, but the result is just weird: it works only on a small part of the screen.

$.parallaxify.positionProperty.mytransform= {
        setPosition: function($element, left, originalLeft, top, originalTop) {
            $element.css('transform', translateX(-' + left + 'px) translateY(-' + top + 'px)');
        }
    };

any idea on why?

@bluantinoo
Copy link
Author

Ok solved (and pasted wrong code . Stupid question:

$.parallaxify.positionProperty.mytransform= {
        setPosition: function($element, left, originalLeft, top, originalTop) {

            $element.css('transform', 'translate(' + (originalLeft - left) + 'px, ' + (originalTop - top) + 'px)');
       }
   };

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

1 participant