【发布时间】:2012-04-10 02:15:48
【问题描述】:
当有人将鼠标悬停在我页面上的图像上时,如何创建这种简单的 jQuery 效果?
一个 JSFiddle 示例 can be found here.
我希望当有人输入图像或框的任何部分时,文本区域应该扩大以显示更多细节。
鼠标离开时,文本区域应该缩小并且只允许图像可见。
这是我的尝试:
$("#free-roster .roster-container .champion").mouseenter(function () {
$(this).find(".info").animate({ width: "116px" }, 400);
});
$("#free-roster .roster-container .champion").mouseleave(function () {
$(this).find(".info").animate({ width: "0px" }, 400);
});
【问题讨论】:
-
这是什么
$("#.champion")。你抢的是班级还是身份证? -
我不知道为什么它会那样复制,修复它。有一个活生生的例子来看看我在说什么,谢谢!
标签: jquery image jquery-animate