2011-01-10 3 views
1

작동하지 않습니다 애니메이션 : 그것은 잘 작동하지만, 파이어 폭스에서jQuery.animate()와() IE7에서 콜백이 코드가

var items = jQuery('#main .imgteaser .txtwrap'); 

items.css("opacity","0.8"); 

items.mouseenter(function(){ 
    alert('enter'); 
    jQuery(this).animate({ 
    bottom: "0", 
    opacity: 1, 
    border: "1px solid #a6a6a6" 
    }, 500, function(){alert('enter animation ready');}); 
    jQuery(this).addClass('hover'); 
}); 

items.mouseleave(function(){ 
    alert('leave'); 
    jQuery(this).animate({ 
    bottom: "-60", 
    opacity: 0.8, 
    border: "1px solid #fff" 
    }, 500, function(){alert('leave animation ready');}); 
    jQuery(this).removeClass('hover'); 
}); 

가 IE7에서 휴가 jQuery를 애니메이션이 작동하지 않습니다 및 콜백 함수도 작동하지 않습니다.

+0

실제 코드입니까? (* copy/pasted? *) 그렇다면,'console.log'를 주석 처리하십시오. 또한, 온라인에 뭔가를 넣을 수 있다면 (* 또는 HTML도 보여줄 수 있습니다.) 많은 도움이 될 것입니다. –

+0

경고 할 console.log를 변경했습니다. –

+0

** leave ** 함수 (* 콜백 *)에서 경고 뒤에 닫는 괄호'}'가 없습니다. –

답변

1

: 나는 한 번에 배경 색상을 애니메이션 플러그인을 발견 http://bugs.jquery.com/ticket/5001

을, 하지만 지금은 플러그인을 찾을 수 없습니다 " 국경을위한 "수정"애니메이션. 제자리에 플러그인으로 http://plugins.jquery.com/project/color

단지 새로운 배경을 통과 평소와 같이 .animate() 전화 :

한 가지 방법은 주위에 다음이 플러그인을 사용하여 그 전체 자리의 배경을 애니메이션 1px의 패딩 자리 내부 요소를 배치하는 것입니다 색깔.

+0

고마워, 그게 나를 위해 일한다! :) –

1

애니메이션 배열의 마지막 항목 뒤에 ,이 없는지 확인하십시오! FF로 처리 할 수 ​​있습니다. IE가 아닙니다.

$('#clickme').click(function() { 
    $('#book').animate({ 
    opacity: 0.25, 
    left: '+=50', 
    height: 'toggle' 
    }, 5000, function() { 
    alert('finished!!!'); 
    } //      <-- NO COMMA HERE!!! 
); 
}); 
+0

나는 이것을 확인했지만, 쉼표가 없습니다. –

1
items.mouseenter(function(){ 
    alert('enter'); 
    jQuery(this).animate({ 
    bottom: "0", 
    opacity: 1, 
    border: "1px solid #a6a6a6" 
    }, 500, function(){alert('enter animation ready');); //<-- you are missing the closing bracket here 
    jQuery(this).addClass('hover'); 
}); 

수정 : jQuery를 단순히 IE의 경계 애니메이션 실패

items.mouseenter(function(){ 
    alert('enter'); 
    jQuery(this).animate({ 
    bottom: "0", 
    opacity: 1, 
    border: "1px solid #a6a6a6" 
    }, 500, function(){alert('enter animation ready');}); 
    jQuery(this).addClass('hover'); 
}); 
+0

예이 누락 된 대괄호가 이미 있습니다. 그러나 데모에서 : http://pplum.de/demo.html 닫는 괄호가 있고 IE7에서 작동하지 않습니다. –

관련 문제