이렇게하면 많은 어려움이 있습니다. "풀다운 아코디언 하위 메뉴"(더 나은 이름이 없음)를 만들고 있습니다. 내 스크립트는 작동하지만 HOVER에서만 작동합니다. .click, .on ("클릭"), .on ("클릭", "리") 등을 사용하려고하면 아무 것도 작동하지 않습니다. 이 스크립트는 .hover를 사용할 때만 작동합니다..hover Works, On Click하지 않습니다.
참고! 클릭 이벤트가 발생하는 것은 "#TopMenu"뿐입니다. 하위 메뉴 ('#accordion')가 마우스 오버됩니다.
아이디어가 있으십니까?
작업 : 클릭하는 "#TopMenu 변경"
$(document).ready(function() {
$('#accordion li').hover(function() {
$(this).find('ul').stop(true, true).slideDown()
}, function() {
$(this).find('ul').stop(true, true).slideUp()
}).find('ul').hide()
$('#TopMenu li').hover(function() {
$(this).find('li').stop(true, true).slideDown()
}, function() {
$(this).find('li').stop(true, true).slideUp()
}).find('li').hide()
});
가 작동하지 않습니다 :이 이상 견과류거야 http://jsbin.com/nidazuq/3/embed?html,js,output
:
$(document).ready(function() {
$('#accordion li').hover(function() {
$(this).find('ul').stop(true, true).slideDown()
}, function() {
$(this).find('ul').stop(true, true).slideUp()
}).find('ul').hide()
$('#TopMenu li').on('click', function() {
$(this).find('li').stop(true, true).slideDown()
}, function() {
$(this).find('li').stop(true, true).slideUp()
}).find('li').hide()
});
내가 작업 여기에 검사를 , 나는 높고 낮은 해결책을 찾았다. 도와주세요.
데모 용도로 HTML 마크 업을 추가 할 수 있습니까? – guradio
"작업 테스트"가 작동하지 않는 것 같습니다. – Tibrogargan