How to extend a button touch area in HTML5 for iPad?
How do I extend the touch area around a div which has a bound touchstart event attached?
My code:
$('#div_button').bind('touchstart', function(e)
{
// button action
});
I want the area around the button to trigger the touchstart for that button, because otherwise you have to tap your finger exactly开发者_JS百科 on the button or the touchstart event wont be triggered.
The question is answered here for native iOS apps, but I want to do the same thing in an HTML5 Safari App for iPad.
How to extend a button touch area?
Hard to tell without the full code or an example.
How about adding a lot of padding
to the div
?
Depending on how #div_button
is coded, this could allow for a much larger clickable area.
精彩评论