pixelcog/parallax.js

Change parallax-window opacity

Closed this issue · 7 comments

I need to reduce the opacity of the parallax-window, but when set via css:

.parallax-window{ opacity: .5; }

nothing change.

Someone may tell me how do I do? Thanks

Set it on .parallax-mirror or .parallax-slider instead.

What should you do if you want different opacity on different parallax-mirrors within the same page? Or different styling in general for that matter. Since the elements are appended directly to the body there's no way to differentiate between them.

:nth-of-type()?

I could implement a less hacky way to do it but it doesn't look like pull requests are being looked at.

That's what I'm doing now and it's okay for my purposes but if I ever need parallax backgrounds in an unpredictable order I'd have a problem.

When I've got some free time I can throw something together for you. How about data-mirror-class="foo" on the window, resulting in <div class="parallax-mirror foo">?

Another option would be to use fork #134, but I've found nesting like that can cause some pretty bad performance issues so I wouldn't recommend.

That sounds like a good solution! Thank you.

I have added parallax-slider class and applied opacity in my webpage, in developer tools when I saw opacity is working nice on mobile phones but when in my mobile phone I opened my project opacity is not working. I have tried second class parallax-mirror too, but the same thing is happening to me, no opacity on the mobile phone.

[https://codepen.io/naveencoder/full/GwPypd](Here is the link of my project you can also check on your mobile phone)