在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 教程/ HTML/ jQuery UI Spiner 示例
jQuery UI Tab 示例(一)
jQuery UI Datepicker 示例(四)
jQuery UI 示例
jQuery UI Slider 示例(二)
jQuery UI Dialog 示例(一)
HTML Get
動畫效果
終止動畫
回調(diào)函數(shù)
方法鏈
jQuery UI Button 示例(一)
jQuery UI Autocomplete 示例(三)
jQuery UI Autocomplete 示例(二)
設(shè)置或取得元素的 CSS class
jQuery UI 概述
基本語法
jQuery UI Datepicker 示例(一)
jQuery UI Autocomplete 示例(一)
jQuery UI Spiner 示例
jQuery UI Tab 示例(二)
淡入淡出效果
顯示/隱藏內(nèi)容
HTML Set
jQuery UI Tooltip 示例
jQuery UI Slider 示例(一)
讀寫 HTML 元素的 css 屬性
jQuery UI Datepicker 示例(二)
添加HTML元素
操作 HTML 元素的大小
jQuery UI Datepicker 示例(五)
滑動效果
jQuery UI Dialog 示例(二)
jQuery UI Menu 示例
jQuery UI 基本工作過程
jQuery UI Button 示例(二)
jQuery UI Dialog 示例(三)
jQuery UI Datepicker 示例(三)
Selectors
jQuery UI Progressbar 示例
Events
jQuery UI Accordion 示例
刪除HTML元素

jQuery UI Spiner 示例

Spinner 主要用來輸入各種格式的數(shù)字,可以使用鼠標(biāo)滾輪,鍵盤方向鍵來修改輸入值,也支持直接鍵入數(shù)字。支持本地化的輸入金額和時間。

基本用法

下面代碼顯示了 Spinner 的基本用法,設(shè)置和取得 Spinner 的當(dāng)前值。

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>jQuery UI Demos</title>
    <link rel="stylesheet" href="themes/trontastic/jquery-ui.css" />
    <script src="scripts/jquery-1.9.1.js"></script>
    <script src="scripts/jquery-ui-1.10.1.custom.js"></script>
    <script>
        $(function () {
            var spinner = $("#spinner").spinner();

            $("#disable").click(function () {
                if (spinner.spinner("option", "disabled")) {
                    spinner.spinner("enable");
                } else {
                    spinner.spinner("disable");
                }
            });
            $("#destroy").click(function () {
                if (spinner.data("ui-spinner")) {
                    spinner.spinner("destroy");
                } else {
                    spinner.spinner();
                }
            });
            $("#getvalue").click(function () {
                alert(spinner.spinner("value"));
            });
            $("#setvalue").click(function () {
                spinner.spinner("value", 5);
            });

            $("button").button();
        });
    </script>
</head>
<body>

    <p>
        <label for="spinner">Select a value:</label>
        <input id="spinner" name="value" />
    </p>

    <p>
        <button id="disable">Toggle disable/enable</button>
        <button id="destroy">Toggle widget</button>
    </p>

    <p>
        <button id="getvalue">Get value</button>
        <button id="setvalue">Set value to 5</button>
    </p>

</body>
</html>

http://wiki.jikexueyuan.com/project/jquery-tutorial/images/54.png" alt="" />

顯示地圖

本例使用兩個 Spinner,以步長為0.001 做為經(jīng)緯度,然后和 Google 地圖配合,通過 Spinner 修改地圖的中心。

此外為了適應(yīng) Google Map API,需要添加對其引用

代碼如下:

<!doctype html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>jQuery UI Demos</title>
    <link rel="stylesheet" href="themes/trontastic/jquery-ui.css" />
    <script src="scripts/jquery-1.9.1.js"></script>
    <script src="scripts/jquery-ui-1.10.1.custom.js"></script>
    <script src="http://maps.google.com/maps/api/js?sensor=false"></script>
    <script>
        $(function () {
            function latlong() {
                return new window.google.maps.LatLng($("#lat").val(),
                    $("#lng").val());
            }
            function position() {
                map.setCenter(latlong());
            }
            $("#lat, #lng").spinner({
                step: .001,
                change: position,
                stop: position
            });

            var map = new window.google.maps.Map($("#map")[0], {
                zoom: 8,
                center: latlong(),
                mapTypeId: window.google.maps.MapTypeId.ROADMAP
            });
        });
  </script>
  <style>
  #map {
    width:500px;
    height:500px;
  }
  </style>
</head>
<body>

<label for="lat">Latitude</label>
<input id="lat" name="lat" value="44.797" />
<br />
<label for="lng">Longitude</label>
<input id="lng" name="lng" value="-93.278" />

<div id="map"></div>

</body>
</html>

http://wiki.jikexueyuan.com/project/jquery-tutorial/images/55.png" alt="" />