I'm attempting to create a div that rotates and moves along the Y axis at the same time. I've been successful in getting each movement to work individually, but not concurrently. Below is the code I am using to rotate the div:
function rotate_horizon_bg(deg){
var rotate = "rotate(" + (deg) + "deg);";
var tr = new Array(
"transform:" + rotate,
"-moz-transform:" + rotate,
"-webkit-transform:" + rotate,
"-ms-transform:" + rotate,
"-o-transform:" + rotate
);
var horizon_bg = document.getElementById("horizon_bg");
horizon_bg.setAttribute("style", tr.join(";"));
}
While this code works perfectly for rotating the div, if I create a new function for translateY, only translateY will take effect.
Does anyone have any suggestions on how I can achieve simultaneous rotation and translation along the Y axis?