开发者

How to extend a button touch area in HTML5 for iPad?

开发者 https://www.devze.com 2023-04-03 17:58 出处:网络
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)

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号