案例:jQuery UI案例     状态:可编辑再运行    进入竖版
 运行结果 
AخA
 
1
<!doctype html>
2
<html>
3
<head>
4
  <meta charset="utf-8">
5
  <title>jQuery UI 旋转器(Spinner) - 地图</title>
6
  <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
7
  <script src="https://maps.google.com/maps/api/js?sensor=false"></script>
8
  <script src="//code.jquery.com/jquery-1.9.1.js"></script>
9
  <script src="/static/js/jqueryui/resources/demos/external/jquery.mousewheel.js"></script>
10
  <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
11
  <link rel="stylesheet" href="https://jqueryui.com/resources/demos/style.css">
12
  <script>
13
  $(function() {
14
    function latlong() {
15
      return new google.maps.LatLng( $("#lat").val(), $("#lng").val() );
16
    }
17
    function position() {
18
      map.setCenter( latlong() );
19
    }
20
    $( "#lat, #lng" ).spinner({
21
      step: .001,
22
      change: position,
23
      stop: position
24
    });
25
 
26
    var map = new google.maps.Map( $("#map")[0], {
27
      zoom: 8,
28
      center: latlong(),
29
      mapTypeId: google.maps.MapTypeId.ROADMAP
30
    });
31
  });
32
  </script>
33
  <style>
34
  #map {
35
    width:500px;
36
    height:500px;
37
  }
38
  </style>
39
</head>
40
<body>
41
 
42
<label for="lat">纬度</label>
43
<input id="lat" name="lat" value="44.797">
44
<br>
45
<label for="lng">经度</label>
46
<input id="lng" name="lng" value="-93.278">
47
 
48
<div id="map"></div>