Similar to this question, I have a nested div that is the full width and height of its parent. However, unlike the other question, I want to animate a translation of the nested div, so the suggested fix of position:static is not applicable.
The following is my test case:
HTML:
<div id="theBox">
<div id="innerBox"></div>
</div>
CSS:
#theBox {
border: 1px solid black;
border-radius: 15px;
width: 100px;
height: 30px;
overflow: hidden;
}
#innerBox {
width: 100%;
height: 100%;
background-color: gray;
-webkit-transition: -webkit-transform 300ms ease-in-out;
-moz-transition: -moz-transform 300ms ease-in-out;
}
JavaScript:
setTimeout(function () {
var innerBox = document.getElementById("innerBox");
var transformText = "translate3d(70px, 0, 0)";
innerBox.style.webkitTransform = transformText;
innerBox.style.MozTransform = transformText;
}, 1000);
This works fine in Firefox 15.0.1, but in Safari 6.0.1, the inner div is not clipped by the parent div's curved border.
Is there a work-around for this issue?