pixelcog / parallax.js

Simple parallax scrolling effect inspired by Spotify.com implemented as a jQuery plugin
MIT License
3.53k stars 840 forks source link

Background position in % #262

Closed Mr0Cake closed 6 years ago

Mr0Cake commented 6 years ago

It is at the moment not possible to specify background position x and y in percent. it gets parsed to a regular number. Is it even possible to convert relative background positions to the translate3d?

wstoettinger commented 6 years ago

Hi @Mr0Cake!

could you please specify your question?

we don't use "backgrounds" in the css or html sense. Are you referring to the parallax-slider element? Why would you need relative positions?

Mr0Cake commented 6 years ago

Hi The situation that I am in now is that I use jquery focuspoint (only the background position in %). This will re position the background image to keep the selected point in vision while resizing.

This is good on static images, but not so good for parallax scrolling.

I hoped that there was a way to convert the percentages i have from focus point to position the inital starting postition of the parallax effect. (and that it positions correctly while resizing the page)

The solution would now be to not do them both.

Already thanks for your answer to my quick questions!

wstoettinger commented 6 years ago

i can't quite follow you. could you provide an example link for demonstration?