나를 미치게하는 문제가 있습니다. 여기 내 코드입니다 :jQuery 이벤트가 페이지로드에 첨부되지 않았습니다.
<a href="#" class="panel-minimize">
<i class="fa fa-chevron-up text-white"></i>
</a>
$(document).ready(function() {
$('.panel-minimize').click(function (e) {
e.preventDefault();
var $target = $(this).parent().parent().parent().next('.panel-body');
if ($target.is(':visible')) {
$('i', $(this)).removeClass('fa-chevron-up').addClass('fa-chevron-down');
}
else {
$('i', $(this)).removeClass('fa-chevron-down').addClass('fa-chevron-up');
}
$target.slideToggle();
});
$(".user_details").colorbox({ iframe: true, innerWidth: 425, innerHeight: 344 });
});
매우 간단하고 실행하기로하지만 ... 내가 $(document).ready
에 경고를 추가하지 않고는 경고를 표시하지만 이벤트가 없습니다 일. $(document).ready
안에 코드를 넣고 크롬에 콘솔을 넣으면 잘 동작하지만 알 수없는 이유로 페이지가로드 될 때 자체적으로 작동하지 않습니다.
어떻게'.panel-minimize' 요소를 추가합니까 –
내 HTML에 하드 코딩 됨 –
콘솔에 오류 ??? 온라인으로 이슈를 복제 할 수 있습니까? –