I would like to have a combobox open automatically on browsers for Android devices.
I have the following code:
<!doctype html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<script src="jquery-1.8.0.min.js" type="text/javascript"></script>
<title>Combobox</title>
</head>
<body>
<div id="combobox">
<select id="select">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
</select>
</div>
<script>
$(document).ready(function() {
document.getElementById('select').size=3;
});
</script>
</body>
</html>
This works on desktop browsers (see screenshot 1), but unfortunately not with browsers on Android devices (see screenshot 2), only after touching the combobox currently the options appear:
I would like them to appear immediately after opening the page (see screenshot 3)
and if possible to show only 3 options (the other options after scrolling):
How can I do that?
EDIT 1: Meanwhile I found a similar problem here, but as it seems to be also without solution...
EDIT 2: I now found a workaround with jQuery Mobile and a listview, see answer below, however I'm still waiting for other (better) ideas...