jQueryで、画像をhover時にキャプション表示させるJavaScriptです。
画像をhover時に、alt内の文章をキャプション表示させる機能です。
↓以下が実際のソースサンプルです。
▼JavaScript
$(function () {
$("li").hover(function () {
$(this).append("" + $(this).children("img").attr("alt") + "
");
$(this).children("div").stop().fadeIn(300);
$(this).children("div").children("p").stop().animate({
"top": 0
}, 300);
}, function () {
$(this).children("div").stop().fadeOut(300);
$(this).children("div").children("p").stop().animate({
"top": "10px"
}, 300, function () {
$(this).parent("div").remove();
});
});
});
▼CSS
