$(".class").each(function () {
var get = $(this).children("ul").attr("id");
$(this).hover(function () {
$("#" + get).stop(true, true).slideDown(300);
}, function () {
$("#" + get).stop(true, true).slideUp(300);
});
});
转载于:https://www.cnblogs.com/wangtiantian/p/4999814.html