I have this sliding down header which slides down when it is pressed.
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
});
The header and the "delete me" button works okay on a computer, but doesn't work on my iPhone and iPad, has any one tried this before?