Jquery 1.7.1을 사용하여 이름이 .interest-group 인 div를 토글합니다. 링크를 클릭하면 .interest-group이라는 다음 div가 열립니다. 지금 당장은 .interest 그룹 div가 모두 표시되도록 전환 할 수 있지만 한 번에 하나만 표시 할 수 있도록하려고합니다. 어떻게해야합니까?Jquery를 사용하여 요소 전환
JSFIDDLE : http://jsfiddle.net/DWwKs/6/ 다음
내 JQuery와 있습니다 :
여기$(document).ready(function() {
$('.interest').toggle(
function() {
$(this).next('.interest-group').show();
},
function() {
$(this).next('.interest-group').hide();
});
});
전환은 첫 번째 인수로 기능을 (내가 아는까지로)하지 않습니다 http://api.jquery.com/toggle/ –