здесь my fiddleПочему наведение и щелчок не всегда работают?
Довольно много работает отлично, кроме иногда MouseEnter, MouseLeave, нажмите функцию (.item) не всегда работает - и необходимо нажать для того, чтобы снова начать работать? почему это - вот мой код -
$(document).ready(function() {
$('.timelineTile').click(function (evt) {
evt.stopPropagation();
$('.timelineTile').not(this).removeClass('clicked').find('.pull_down_content').height(0);
$(this).toggleClass('clicked');
if(!$('.timelineTile').hasClass("clicked")){
$(this).children('.pull_down_content').height(0);
}
}); });
$(document).click(function() {
$('.timelineTile').removeClass('clicked');
$('.pull_down_content').height(0);
$('.inner').stop().css({'display': 'none'}, 300);
});
$(document).ready(function() {
$('.timelineTile').children('.item').on('mouseenter mouseleave click', function(e) { e.stopPropagation();
if ($(this).parent('.timelineTile').hasClass("clicked")) {
if (!$(this).data('clicked')) {
var Height = e.type==='mouseenter' ? '90px' : e.type==='click' ? '250px' : '0px';
$(this).siblings('.pull_down_content').stop().animate({'height': Height}, 300);
$(this).siblings('.pull_down_content').children('.inner').css({'display': 'block'}, 300);
if (e.type==='click') $(this).data('clicked', true);
}else{
if (e.type==='click') {
$(this).data('clicked', false);
$(this).siblings('.pull_down_content').stop().animate({'height': '0px'}, 300);
$(this).siblings('.pull_down_content').children('.inner').css({'display': 'none'}, 300);
}
}
}
});
});
Я не уверен, что это с этим связано?
if(!$('.timelineTile').hasClass("clicked")){
$(this).children('.pull_down_content').height(0);
}
спасибо, я изменил к этому - но его до сих пор получил ту же ошибку –
Вы включены все необходимые файлы? –
У меня есть ответ для этого сейчас. –