开发者

android webkit onclick event not firing in select list

Hi i have this in a html page android(2.1) webkit

    <SELECT  id="my_id"  onclick="my_click();" >    </SELECT>

If you click on t开发者_如何学编程he combo box an empty list is displayed on android emulator.

I do not want to display a empty list , if its empty. I want to intercept this in the on click event. The onclick event is not firing. The onchange event is working. only the onchange event fires , onmousedown, onmouseup etc don't fire.

This works in chrome and in iphone webkit ..

anyideas? mike


I don't know that you can capture the onclick event for a select list, since that event only actually fires once an option is selected (in Android's webkit, that is...iPhone and Chrome webkit engines don't process the event the same way). However, you could take another route; the idea is to hide the list if it's empty, so do something like this to count the number of options:

$('#my_id option').size();

...then set display:none if the returned value is less than 1.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜