mouseenter、live、setTimeout関数を組み合わせてアニメーションを作成しようとしています
$(".kundenList li").live("mouseenter", function(){
if ($(this).children().length > 0) {
$(this).data('timeout', setTimeout( function () {
$(this).children("div.description").css({opacity: '0'});
$(this).children("div.blacklayer").animate({
opacity: '0.85'
}, 300);
$(this).children("div.description").animate({
top: "-=200px",
opacity: '1'
}, 300).css( 'cursor', 'pointer' );
$(this).addClass("activeLI");
}, 300));
}
});
HTMLはこんな感じ
<ul class="kundenList">
<li>
<img src="t3.png" class="kundenImg" />
<div class="blacklayer" style="opacity: 0;"></div>
<div class="description">
<h3>Title</h3>
<p>Description</p>
</div>
</li>
</ul>
私は質問のスクリプトを投稿しているので、明らかに機能しません:)。理由を知っている人はいますか?ありがとう。
PS ajax経由で新しいコンテンツをロードしているので、ライブ機能が必要です