I am doing a divs animation project to smoothly navigate to the user view page. I notice that the div will stick to the right and move with the help margin-left:-700pxthat I set, but did not move the entire div from left to right.
function show(elem)
{
elem = getElem(elem);
if (elem)
{
elem.style.display = "block";
var cssAnimation = document.createElement('style');
cssAnimation.innerHTML = "@keyframes pulseOnce { 0% {margin-left: -700px;} 50%{margin-left: 10px;} 75%{background-color:black;color:white;} 100%{background-color:white;color:inherit;} }";
cssAnimation.innerHTML += "@-webkit-keyframes pulseOnce { 0% {margin-left: -700px;} 50%{margin-left: 10px;} 75%{background-color:black;color:white;} 100%{background-color:white;color:inherit;} }";
document.head.appendChild(cssAnimation);
elem.style.animation = "pulseOnce 1.5s 1";
elem.style.webkitAnimation = "pulseOnce 1.5s 1";
}
return elem;
}
In addition, immediately after choosing a budget option, budgetFormit will simultaneously move both budgetForm, and brandFormthat I do not want, and the rest after that is compatible and does not experience any problems, This happens in show(elem) function. How to prevent simultaneous animation?
, , , queryBox , , . margin-left:1000px;. , , ?
, Reset All , , , - , , .
- , , , , . . , jQuery!
, , jsfiddle: http://jsfiddle.net/WLAC5/