How to create image captions with 'alt' text using jquery click function
问题 I'm creating an image gallery that shows the alt text as captions for each individual image. Right now I have something that uses the mouseenter/mouseleave function for this desired result. JS $(function () { $(".thumb").mouseenter(function () { var $t = $(this); var $d = $("<div>"); $d.addClass("desc").text($t.attr("alt")).css({ width: $t.width(), height: $t.height() - 20, top: $t.position().top }); $t.after($d).fadeTo("fast", 0.3); $d.mouseleave(function () { $(this).fadeOut("fast", 0,