0
나는 jQuery를의 애니메이션() 함수에 문제가 :jQuery를 사용하여 너비를 애니메이션화하고 동시에 새 왼쪽 위치를 계산하는 방법은 무엇입니까?
$(this).addClass(activeClass).animate({
position: 'absolute'
width: '200%',
//Here is the problem. I need the new outerWidth(true)
//(Width+Padding+Margin+Border) of the animated element to calculate
//the new position. I want it to be centered from it's old position.
//But it is still using the current outerWidth.
left : -($(this).outerWidth(true)-defaultOuterWidth)/2
});
예 :
의는 내가 200 % 크기를 조정할 사업부 있다고 가정 해 봅시다. div는 처음에는 여백이 20px이고 너비는 200px입니다. I 필요한 따라서
) 상기 "activeClass"가 적용된 후
는 마진 지금 40px 다양한 것이있을 수, 지금 테두리와 400 픽셀의 새로운 폭 애니메이션() 함수이므로 상기 때문을 갖는다 new outerWidth (true) 새로운 위치를 계산하기 위해서 애니메이션의 도중에.
모든 솔루션?