0

I am uising curtains.js from github asa a parallax effect but I want to change animation effect. When I am scrolling current element goes up but I want next elements to come above current does anyone have some ideas how to do that

Thanks

gman
  • 100,619
  • 31
  • 269
  • 393
Andrew Ceban
  • 118
  • 15

1 Answers1

0

I'm guessing you are asking about how to position the different layers on top of each other?

If so you need to use z-index.

The z-index property specifies the stack order of an element.

An element with greater stack order is always in front of an element with a lower stack order.

Note: z-index only works on positioned elements (position:absolute, position:relative, or position:fixed).

danwild
  • 1,886
  • 1
  • 26
  • 31
  • yep each next element take -1 z-index that makean effect like they are behind ... and one more thing is that current ellement goes in minus margin top but I thing the solution will be to make each ellement +1 z indext and to start giving negativ margin top from second element but I am not so good in JQ. Any ideas? – Andrew Ceban Dec 27 '13 at 09:24
  • Negative z-index values *should* still be valid, but you should definitely try positive ones in case there is some conflict. It is hard to understand what exactly the problem is that you are having now - how do margins relate to your problem? Please post some code or examples. – danwild Dec 27 '13 at 11:34