I am encountering an issue with a div element that has jQuery appended to it for a bounce effect. The element is absolutely positioned within its relative parent. However, when the browser is resized, the child element does not remain centrally aligned during resizing until the browser stops being resized.
Could anyone provide some advice on how to prevent this from happening?
Here is the HTML code:
<div class="row">
<div class="col-md-12">
<div class="test">
<div id="buttonbounce"></div>
</div>
</div>
</div>
And here is the script:
$(document).ready(function() {
function doAnimation() {
$("#buttonbounce").effect( "bounce", {times:3}, 1000, doAnimation);
}
doAnimation();
});
To see this in action, please visit my CodePen link below: