I have a slider that I tried to work. This demo had 3 slides, but I'm trying to add 4. When I add it, element 4 will either
- On the back
- Under the image of the right side
I'm not quite sure how I can fix this, if there is a way. To help describe what I'm looking for, imagine the following is my diagram:
[back img] [left img] [right img] [front img]
I'm trying to make it spin. You can currently see the front / left / right images that I need, but you can also see the inverse image.
Essentially, I need the reverse image to be hidden, so whatever image is in that place, hide it.
Here is the setup in HTML
<div class='p_slider'> <div class='p_slider__item'> <img src='https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/iwatch1.png'> </div> <div class='p_slider__item'> <img src='https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/iwatch2.png'> </div> <div class='p_slider__item'> <img src='https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/iwatch3.png'> </div> <div class='p_slider__item'> <img src='https://s3-us-west-2.amazonaws.com/s.cdpn.io/217233/iwatch3.png'> </div> </div>
CSS positioning
.p_slider__item:nth-of-type(1) { -webkit-transform: scale(0.6); -ms-transform: scale(0.6); transform: scale(0.6); left: -200px; -webkit-filter: blur(2px); opacity: 0.8; z-index: 1; } .p_slider__item:nth-of-type(2) { -webkit-transform: scale(1); -ms-transform: scale(1); transform: scale(1); left: 0px; z-index: 2; } .p_slider__item:nth-of-type(3) { -webkit-transform: scale(0.6); -ms-transform: scale(0.6); transform: scale(0.6); left: 200px; z-index: 1; -webkit-filter: blur(2px); opacity: 0.8; } .p_slider__item:nth-of-type(4) { -webkit-transform: scale(1); -ms-transform: scale(1); transform: scale(1); left: 0px; z-index: 2; }
I have a little more code nested into this, but to keep it short, I also have this JS Fiddle link . I know this is a pretty ordinary job, so I appreciate all the help I get! Thanks!
What i tried
updated 4-point violin, all moving here: DEMO
So now I have 4 elements in rotation, but the slider wants to do this.
Move the front image to the right
Center left image
Move (new center) img to the left and replace it to the left
Move (new center) to the right, move left to center