I am animating an image enclosing in a div, which moves from a <li>
to some other div. The destination div contains a span having content.
What I need that, when image div appends to destination div, the all content (span text and appended img div) should be vertically centered.
var des = $(".destnation").position();
var el = $(".toMove");
el.css("position", "absolute");
el.animate({ top: des.top+"px" ,left :des.left+"px"}, 2000, undefined, function () {
el.remove().appendTo(".destnation").css("position", "static");
});
.destination {
height: 4.9em;
width: 100%;
overflow: hidden;
text-align: left;
vertical-align: middle;
}
.destination span {
color: #3366CC;
font: 1.50em georgia, garamond, serif;
margin-top: 0.625em;
margin-bottom: 0.625em;
display: block;
}