I'm experiencing an issue with the animation I've implemented causing some slight shaking and wobbling of the text and certain elements which is affecting the overall look. You can view a live example of this behavior here:
This problem specifically occurs when displaying the "days left" over the register menu item.
Below are the code fragments that contribute to this issue:
<ul id="menu">
<li></a><a href="register.php">REGISTER</a><div id="register_hover"><span>REGISTER NOW!</span><div id="register_hover_arrow"></div></div></li>
</ul>
#menu {
text-align: justify;
width: 50em;
height: 1em;
}
#menu li {
position: relative;
}
#register_hover {
-webkit-border-radius: 2px;
background-color: #FFA200;
-moz-border-radius: 2px;
letter-spacing: 0.25em;
font-weight: normal;
position: absolute;
border-radius: 2px;
text-align: center;
font-size: 0.9em;
height: 1.5em;
width: 300%;
top: -2.5em;
left: -100%;
}
#register_hover span {
position: relative;
top: .25em;
z-index: 2;
}
#register_hover_arrow {
margin: 0 auto;
-webkit-transform: translateY(-.8em) rotate(45deg);
-ms-transform: translateY(-.8em) rotate(45deg);
transform: translateY(-.8em) rotate(45deg);
background-color: #FFA200;
position: relative;
height: 1em;
z-index: 1;
width: 1em;
top: .6em;
}
Javascript fragment:
var animateDeadlineAlert = function() {
var originalYOffset = $('#register_hover').css('top');
$('#register_hover').animate({
'top': '-3em'
}, function() {
$(this).animate({
'top': originalYOffset
}, function() {
animateDeadlineAlert();
});
});
};
animateDeadlineAlert();
JSfiddle link for reference: http://jsfiddle.net/wd0xj3rb/