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

Make css top and left #242

Closed
Alissonk opened this issue Feb 13, 2018 · 6 comments
Closed

Make css top and left #242

Alissonk opened this issue Feb 13, 2018 · 6 comments

Comments

@Alissonk
Copy link

Hello, I would like to know how to set the css of the elements in the scene, because the plugin overlaps the top and the left in the css ...

@liquidvisual
Copy link

liquidvisual commented Mar 18, 2018

I don't like how the plugin does this, in many of my use cases I need to set my own top and left but the opinionated inline styles override everything.

@reneroth
Copy link
Collaborator

position the child elements of the layers instead

@gterras
Copy link

gterras commented May 22, 2018

For reference, you need to wrap your layer in a positionable element like this :

<div id="parallax">
	<div  id="myabsoluteelement"><div class="layer"></div></div>
</div>

Then use selector : '.layer' on parallax init.

@geosem42
Copy link

geosem42 commented Jan 6, 2019

For reference, you need to wrap your layer in a positionable element like this :

<div id="parallax">
	<div  id="myabsoluteelement"><div class="layer"></div></div>
</div>

Then use selector : '.layer' on parallax init.

I can confirm, this works like a charm.

@patternica
Copy link

patternica commented Feb 10, 2020

You simply can use "!important" for your top and left values. Then it will deactivate values from the lib.

top: 50% !important;
left: 50% !important;

@LucaRosaldi
Copy link

Inline styles are a major pain in the butt. Call me a purist, but I feel bad every time I have to override a style with !important.

I ultimately forked the library and removed the javascript which set the inline styles.
Now I cannot update the library, though. 😢

It would be great to at least have an option to disable inline styles.

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

7 participants