$('.content').hide();
var $elms = $('.fruit, .vegetable, .dairy');
$elms.hover(function() {
var $content = $(this).next('.content');
$content.stop(1, 1).slideToggle(400);
});
http://jsfiddle.net/elclanrs/GBkMB/1/
편집 대답 당신이 앞으로 이동하고 싶은 아이디어를 제공해야합니다 :
는 백업 슬라이딩에서 콘텐츠를 방지하기 위해 중첩 할 수 있도록 같은 div
의 :
<div class="fruit">fruit
<div class="content fruit_types">apple<br/>bannana<br/>orange</div>
</div>
<div class="vegetable">vegetable
<div class="content vegetable_types">celery<br/>lettuce<br/>cucumber</div>
</div>
<div class="dairy">dairy
<div class="content dairy_types">milk<br/>cheese<br/>butter</div>
</div>
JQ :
이
$('.content').hide();
var $elms = $('.fruit, .vegetable, .dairy');
$elms.hover(function() {
var $content = $(this).children('.content'); //<-`children()` not `next()`
$content.stop(1,1).slideToggle(400);
});
예 : 당신은이 그림을 얻을 http://jsfiddle.net/elclanrs/GBkMB/5/
, 두가/아주 쓸모있는 세 가지 대답 은요? – Relic