부트 스트랩 documentation 쉽게 다음 코드를 사용하여 데이터 API를 사용하지 않도록 설정할 수 있습니다 말한다 :부트 스트랩 데이터 속성 API를 비활성화 하시겠습니까?
$('body').off('.data-api');
내가 그 다른 자바 스크립트가 동일한 데이터 속성을 사용하는 경우, 정말 멋진 생각했다. 특수 영역에서 bootstrap-API 만 비활성화하면됩니다. 각각-태그의 API를 사용하지 예를 들어
:
<html>
<head>
<title>Bootstrap - Test - Disable The API</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script>
$(document).ready(function() {
//This is working: $(document).off('.data-api');
//This is not working:
$('a').off('.data-api');
});
</script>
</head>
<body>
<!-- Button to open the modal -->
<a id="clickBtn" href="#myModal" data-toggle="modal">Launch demo modal</a>
<!-- Modal -->
<div id="myModal" class="modal hide fade">
This is just a little test
</div>
</body>
</html>
하지만이 작동하지 않았다.
모달에 대해 여전히 clickEvent
입니다. 아무도 내가 잘못한 것을 말할 수 있습니까?
$('#clickBtn').off('.data-api');
에도 작동하지 않습니다.