누르면이 슬라이드 다운 헤더가 눌려져 있습니다.iDevices에서 클릭 할 때 사용하는 버튼이 작동하지 않습니다.
DEMO : http://jsfiddle.net/ygAV2/2/
$(document).on("click", 'h1', function() {
if (!$(this).parent().hasClass('header-down')) {
$(this).parent().stop().animate({
height: '100px'
}, {
queue: false,
duration: 600,
easing: 'linear'
}).addClass('header-down');
} else {
$(this).parent().stop().animate({
height: '30px'
}, {
queue: false,
duration: 600,
easing: 'linear'
}).removeClass('header-down');
}
});
$(document).click(function() {
if ($(".box_header").hasClass('header-down')) {
$(".box_header").stop().animate({
height: '30px'
}, {
queue: false,
duration: 600,
easing: 'linear'
}).removeClass('header-down');
}
});
$(document).on("click", ".box_header", function (e) {
e.stopPropagation(); // This is the preferred method.
// This should not be used unless you do not want
// any click events registering inside the div
});
헤더와 버튼이 컴퓨터에 괜찮 작동하지만, 내 아이폰과 아이 패드에서 작동하지 않습니다, 하나는 전에이 시도가 "나를 삭제"?
'live()'는 jQuery 1.7에서 더 이상 사용되지 않으며 1.9에서 제거되었습니다. – BenM
. 내가 살아야한다고 말했어 .live는 비난 받았어. 그래서 내가 가지고있어.? – DWTBC
다른 방법이 있습니까? – DWTBC