Debian Codegraph @

closure-library/closure/goog/demos/popupcolorpicker.html

raw
1 <!DOCTYPE html>
2 <html>
3 <!--
4 Copyright 2010 The Closure Library Authors. All Rights Reserved.
5
6 Use of this source code is governed by the Apache License, Version 2.0.
7 See the COPYING file for details.
8 -->
9 <head>
10 <title>goog.ui.PopupColorPicker</title>
11 <script src="../base.js"></script>
12 <link rel="stylesheet" href="css/demo.css">
13 <link rel="stylesheet" href="../css/colorpicker-simplegrid.css">
14 <script>
15 goog.require('goog.ui.PopupColorPicker');
16 </script>
17 <style>
18 .goog-popupcolorpicker {
19 position:absolute;
20 -moz-outline:0;
21 outline:0;
22 }
23 #button1, #button2 {
24 display: block;
25 width: 60px;
26 text-align: center;
27 margin: 10px;
28 padding: 10px;
29 font: normal 0.8em verdana,sans-serif;
30 border: 1px solid #000;
31 }
32 </style>
33 </head>
34 <body>
35 <h1>goog.ui.PopupColorPicker</h1>
36 <a href="javascript:void(0)" id="button1">Show 1</a>
37 <a href="javascript:void(0)" id="button2">Show 2</a>
38 <script>
39 var picker = new goog.ui.PopupColorPicker();
40 picker.render();
41 picker.attach(document.getElementById('button1'));
42 picker.attach(document.getElementById('button2'));
43
44 goog.events.listen(picker, 'change', function(e) {
45 picker.getLastTarget().style.backgroundColor = picker.getSelectedColor();
46 });
47 </script>
48 </body>
49 </html>