2011-01-10 7 views
1

動作しませんアニメーション:それは良い動作しますが、Firefoxでは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

これは実際のコードですか?もしそうなら、あなたは 'console.log'をコメントアウトしてください。また、オンラインで何かを置くことができれば(*またはHTMLも表示することができます)、それは大いに役立ちます。 –

+0

私はconsole.logを警告するように変更しました。 –

+0

** leave **関数(*コールバック*)のアラートの後に、閉じ括弧 '}'がありません。 –

答えて

1

jQueryのは、単にIEで国境をアニメーションに失敗:http://bugs.jquery.com/ticket/5001

私はかつて、背景色をアニメーション化プラグインを見つけましたしかし、今ではプラグインを見つけることができませんでした "ボーダーのアニメーションを修正します。

一つの方法は、周りに、このプラグインを使用して、その全体のプレースホルダの背景をアニメーション1pxのパディングとプレースホルダ内の要素を配置することです:http://plugins.jquery.com/project/color

場所でプラグインを使用すると、ちょうど新しい背景を渡しいつものように.animate()を呼び出します色。

+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'); 
}); 

修正:

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で動作しません。 –

関連する問題