I have two nested divs, one defines an aria to the right of the screen, and the other is 100% of that. I'm trying animate the child div to the left of the screen instead of the right. I cannot animate the parent div, as it has other children, I tried using the new css3 vw unit, but i need to set the value to negative units for it to move left at all. I have got this to work by getting the size of the element next to it, and animating negative that amount, but once you re-size the window, it gets moved out of place.
My css is:
#sideParent
{
position: absolute;
top: 150px;
bottom: 0px;
right: 0px;
width: 300px;
border-top: 3px solid black;
border-left: 3px solid black;
text-align: center;
}
#sideChild
{
position: absolute;
top: 0px;
left: 0px; /* I need this to position to left of screen with a static value */
right: 0px;
height: 100%;
width: 100%;
background-color: white;
z-index: 100;
border-right: 3px solid black;
}
If there is no other solution, there must be a way to check when the screen is re-sized and change the negative value accordingly. If no one can come up with a solution for the initial problem, can someone please explain how to do this?
thanks in advance.