问题描述:

I have div with background: url('some/path') no-repeat 50% 0 fixed; property set.

My parallax effect is working ok, however because of fixed, image position became relative to viewport, which is expected behavior.

But because of this my background image went up from it's div container(which is positioned relatively bellow some header, with navigation), and thus not showing in it's complete height(talking about image not showing in its complete heIght, not the div itself), but height - header.height.

One solution would be to have my background image higher for that amount of difference.

Is there some better way of solving this, for example what one would do then, if he wanted parallax effect on an image in the middle of the page? Making image that tall in that case is very impractical. Am I misssing something?

something like this, in it's simplest form, just to have better idea.

https://gist.github.com/anonymous/a3f8fedf4f6dfcac6607

相关阅读:
Top