2012-02-17 22 views
0

resizescrollに、次のコードがconsole.logを発していない理由を教えてもらえますか? (jquery 1.7が確実に読み込まれます)。jQueryはサイズ変更とスクロールで起動しません。

<script> 
$(window).live('scroll resize', function() 
{ 
    console.log('am i working?'); 
}); 
</script> 

ありがとうございます。

答えて

2

liveはjQuery 1.7以降では使用されなくなりました。

As of jQuery 1.7, the .live() method is deprecated. 

check Documentation here。代わりにウィンドウだけではなく、何かのために働く.on()on documentation

+0

を使用します:$(ウィンドウ).on( 'スクロール'、 'DIV' 機能を(){...}); –

関連する問題