0
이 이미지가 화면 하단에서 위로 움직여지고 회전됩니다. 그러나 애니메이션이 진행되는 동안 부모 div는 애니메이션이 완료 될 때까지 오버플로를 숨 깁니다. 애니메이션 전체에서 이미지의 모든 부분을 표시하려면 어떻게해야합니까?경계 상자가 움직일 때 이미지의 가장자리를 자르고 있습니다.
예 : http://aws.redemptionconnect.com/redemption/play.html
여기 내 플러그인의 :
$.fn.handMenu = function(){
var config = {
width: 172,
height: 256
}, screen = {
x: ($(window).width()),
y: ($(window).height())
}, numChildren = this.find('.wrapper').children().length, self = this;
function findSpacing(){ var a = (screen.x/2)/numChildren; return (numChildren * config.width >= screen.x/2)? a - ((config.width - a)/numChildren) : 0; }
function resize(){
self.find('.wrapper').css({
'left': ((screen.x/2) - ((findSpacing() == 0)? config.width * numChildren : (screen.x/2)/2)),
'width': ((findSpacing() == 0)? config.width * numChildren : screen.x/2)
}).children().each(function(i){
$(this).css({
'left': (findSpacing() * i)
});
});
}
resize();
$(window).resize(function(){
screen.x = $(window).width();
screen.y = $(window).height();
resize();
});
this.find('.wrapper').hoverIntent(function(){
var wrapper = $(this);
wrapper.animate({
'height': config.height
}, 700).children().each(function(i){
$(this).animate({'left': 50 * i}).rotate({animateTo:(i - (numChildren/2)) * 10});
});
}, function(){
$(this).animate({
'height': 50
}, 600).children().each(function(i){
$(this).animate({'left': (findSpacing() * i)}, 500).rotate({animateTo: 0});
});
});
};
괜찮아 보이는데, 몇 가지 질문이 있습니다. 왜 이미지에있을 때 mouseout 이벤트를 발생시키지 않지만, 당신이 직접적인 오른쪽으로 갈 때 (여전히 x 좌표 안에있는) 않는가? 내가 말하는 것을보기 위해 높이 해상도로보아야 할 수도 있습니다. 내가 실제로 stackoverflow에 게시 한 다른 질문 : http://stackoverflow.com/questions/11194774/bounding-box-is-cutting-off-edges-of-images-when-animating – LordZardeck
복제 할 수 없습니다. 설명 된 호버링 문제가 있지만 폭 문제에 대한 잠재적 인 해결책을 제시했습니다. http://stackoverflow.com/questions/11194631/need-to-total-width-of-rotating-images/11197114#11197114 – r0m4n