0
먼저 도움을 주셔서 감사합니다. 사이드 바 메뉴 목록을 포함하여 본문의 아무 곳이나 클릭하면 본문 클릭을 사용하여 사이드 바를 닫습니다. 나는 목록 메뉴에서만 드롭 다운 메뉴에서 몸 클릭을 비활성화하고 싶습니다. 드롭 다운 버튼을 제외하고 사이드 바 목록 메뉴에서 event.stopPropagation을 사용하십시오.
1
나는$(document).ready(function() {
// Click event on body hide the element
$("#col-click1").click(function() {
if ($(window).width() < (991) && $("body").hasClass("sidebar-open")) {
$("body").removeClass('sidebar-open');
}
});
});
2 내가 thebelow 코드를 사용하려 번째 드롭 다운 메뉴를 열고 리튬에 몸 클릭 이벤트를 사용하지 않으려면 몸의 클릭 이벤트에 대한이 코드를 사용하지만, 내가 그것을 '아무튼 알고 티. 내가 jquery를 사용하여 새로운 해요 대체 솔루션을 찾고 있어요.
<li ui-sref-active="active" id="demo222" class="sidebar-only"><a data- target="#demo2" class="list-group-item list-group-item-success sidebar-only" data-toggle="dropdon" data-parent="#MainMenu"><img src="/app/img/icons/candidate_settings.png" id="input_img0">Mon compte</a></li>
<div class="dropdown-menu" id="demo2">
<li ui-sref-active="active"><a style="color: #7c868d !important; font-weight: 400 !important;" href="" style="cursor: pointer;" class="list-group-item">compte</a></li>
<li ui-sref-active="active"><a style="color: #7c868d !important; font-weight: 400 !important;" href="" style="cursor: pointer;" class="list-group-item">Support</a></li>
<li ui-sref-active="active"><a style="color: #7c868d !important; font-weight: 400 !important;" href="" class="list-group-item" ng-click="logout()">Se sign out</a></li>
</div>
$('#demo222').click(function(event){
event.stopPropagation();
});
안녕하세요, # Enlightener thans 답장을 보내 주신 데 이미 해결책이있는 것으로 알고 있습니다. 방금 body에없는 specefic 클래스에 click 이벤트를 적용했습니다. –