Debian Codegraph @

closure-library/closure/goog/demos/tooltip.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.Tooltip</title>
11 <meta charset="utf-8">
12 <script src="../base.js"></script>
13 <script>
14 goog.require('goog.html.testing');
15 goog.require('goog.ui.Tooltip');
16 </script>
17 <link rel="stylesheet" href="css/demo.css">
18 <style>
19 .goog-tooltip {
20 background: infobackground;
21 color: infotext;
22 border: 1px solid infotext;
23 padding: 1px;
24 font: menu;
25 }
26 .tooltip2 {
27 background: #C0C0FF;
28 color: infotext;
29 border: 1px solid infotext;
30 padding: 1px;
31 font: menu;
32 width: 120px;
33 }
34 span {
35 border-bottom: 1px dotted black;
36 }
37 </style>
38 </head>
39 <body>
40 <h1>goog.ui.Tooltip</h1>
41 <p>
42 <button id="btn1">Hover me</button>
43 <button id="btn2">and me</button>
44 <button id="btn3">and me</button>
45 <button id="btnNoTooltip">but not me</button>
46 </p>
47
48 <p>
49 Demo <span id="txt1">tooltips</span> in text and and of <span id="txt2">nested
50 <span id="txt3">tooltips</span>, where an element triggers
51 one tooltip and an element inside the first element triggers another
52 one.</span>
53 </p>
54
55 <div style="overflow: auto; height: 100px; border: 1px solid black;">
56 <div style="margin: 5px; padding: 5px; height: 200px;">
57 <button id="btn4">and me too!</button>
58 </div>
59 </div>
60
61 <button id="btn5" style="position: absolute; bottom: 5px;">near bottom</button>
62
63 <script>
64 var msg1 = "Tooltip widget. Appears next to the cursor when over an " +
65 "attached element or next to the element if it's active.";
66 var tooltip1 = new goog.ui.Tooltip('btn1', msg1);
67
68 var tooltip2 = new goog.ui.Tooltip('btn2');
69 tooltip2.className = 'tooltip2';
70 tooltip2.setSafeHtml(goog.html.testing.newSafeHtmlForTest(
71 "This is message two, using a different class name for the tooltip and " +
72 "<strong>HTML</strong> <em>markup</em>.<br>" +
73 "<button id=\"btn-nest\">Hover me</button>"));
74 tooltip2.attach('btn5');
75
76 var tooltip3 = new goog.ui.Tooltip('btn3', 'Tooltip for button 3');
77
78 var msg4 = "Tooltip for button 4, demonstrating that it's positioned " +
79 "correctly even when inside a scrolling container.";
80 var tooltip4 = new goog.ui.Tooltip('btn4', msg4);
81
82 var msg5 = "tooltip for the word 'tooltips'."
83 var tooltip5 = new goog.ui.Tooltip('txt1', msg5);
84 tooltip5.attach('txt3');
85
86 var tooltip6 = new goog.ui.Tooltip('txt2', 'outer tooltip');
87
88 var tooltip7 = new goog.ui.Tooltip('btn-nest');
89 tooltip7.setSafeHtml(goog.html.testing.newSafeHtmlForTest(
90 "Even nested<br>tooltips!"));
91 </script>
92 </body>
93 </html>