簡單介紹一下select menu,對于一個做網頁開發的人來說,這個應該就是最簡單的了,是以我也不多說了,為了保證我自己以後需要的時候友善查找,我還是簡單的寫一下,将來友善.
代碼如下:
<!DOCTYPE html>
<html>
<head>
<title>Form Example 6</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/latest/jquery.mobile.min.css" target="_blank" rel="external nofollow" />
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://code.jquery.com/mobile/latest/jquery.mobile.min.js"></script>
</head>
<body>
<div data-role="page">
<div data-role="header">
<h1>Form Demo</h1>
</div>
<div data-role="content">
<form action="echo.cfm" method="post">
<div data-role="fieldcontain">
<fieldset data-role="controlgroup">
<legend>Trip Setup:</legend>
<label for="location">Location</label>
<select name="location" id="location">
<option value="Home">Home</option>
<option value="Work">Work</option>
<option value="Moon">Moon</option>
<option value="Airport">Airport</option>
</select>
<label for="time">Time</label>
<select name="time" id="time">
<option value="Morning">Morning</option>
<option value="Afternoon">Afternoon</option>
<option value="Evening">Evening</option>
</select>
<label for="time">Meal</label>
<select name="meal" id="meal">
<option value="Meat">Meat</option>
<option value="Vegan">Vegan</option>
<option value="Kosher">Kosher</option>
</select>
</fieldset>
</div>
<div data-role="fieldcontain">
<input type="submit" name="submit" value="Send" />
</div>
</form>
</div>
</div>
</body>
</html>
效果如下:

在點選的時候,預設是調用手機上的原生的顯示方式,因為沒有在手機上測試,是以就不截圖了。
最後将代碼中的<fieldset data-role="controlgroup">修改為<fieldset data-role="controlgroup" data-type="horizontal">,可以實作select按鈕的橫向排列。