test_Tooltip.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  2. "http://www.w3.org/TR/html4/strict.dtd">
  3. <html>
  4. <head>
  5. <title>Dojo Tooltip Widget Test</title>
  6. <script type="text/javascript" src="../../dojo/dojo.js"
  7. djConfig="parseOnLoad: true, isDebug: true"></script>
  8. <script type="text/javascript" src="_testCommon.js"></script>
  9. <script type="text/javascript">
  10. dojo.require("dijit.Tooltip");
  11. dojo.require("dojo.parser"); // find widgets
  12. dojo.addOnLoad(function(){
  13. console.log("on load func");
  14. var tt = new dijit.Tooltip({label:"programmatically created tooltip", connectId:["programmaticTest"]});
  15. console.log("created", tt, tt.id);
  16. });
  17. </script>
  18. <style type="text/css">
  19. @import "../../dojo/resources/dojo.css";
  20. @import "css/dijitTests.css";
  21. </style>
  22. </head>
  23. <body>
  24. <h1 class="testTitle">Tooltip test</h1>
  25. <p>Mouse-over or focus the items below to test tooltips. <button onclick="dijit.byId('btnTt').destroy()">Remove</button> tooltip from button.</p>
  26. <p></p>
  27. <div><span id="one" class="tt" tabindex="0"> focusable text </span>
  28. <span dojoType="dijit.Tooltip" connectId="one">
  29. <b>
  30. <span style="color: blue;">rich formatting</span>
  31. <span style="color: red; font-size: x-large;"><i>!</i></span>
  32. </b>
  33. </span>
  34. </div>
  35. <span id="oneA" class="tt"> plain text (not focusable) </span>
  36. <span dojoType="dijit.Tooltip" connectId="oneA">
  37. <span> keyboard users can not access this tooltip</span>
  38. </span>
  39. <a id="three" href="#bogus">anchor</a>
  40. <span dojoType="dijit.Tooltip" connectId="three">tooltip on a link </span>
  41. <p></p>
  42. <span id="programmaticTest">this text has a programmatically created tooltip</span>
  43. <br>
  44. <button id="four">button</button>
  45. <span id="btnTt" dojoType="dijit.Tooltip" connectId="four">tooltip on a button</span>
  46. <span style="float: right">
  47. Test tooltip on right aligned element. Tooltip should flow to the left --&gt;
  48. <select id="seven">
  49. <option value="alpha">Alpha</option>
  50. <option value="beta">Beta</option>
  51. <option value="gamma">Gamma</option>
  52. <option value="delta">Delta</option>
  53. </select>
  54. <span dojoType="dijit.Tooltip" connectId="seven">
  55. tooltip on a select<br>
  56. two line tooltip.
  57. </span>
  58. </span>
  59. <p></p>
  60. <form>
  61. <input type="input" id="id1" value="#1"><br>
  62. <input type="input" id="id2" value="#2"><br>
  63. <input type="input" id="id3" value="#3"><br>
  64. <input type="input" id="id4" value="#4"><br>
  65. <input type="input" id="id5" value="#5"><br>
  66. <input type="input" id="id6" value="#6"><br>
  67. </form>
  68. <br>
  69. <div style="overflow: auto; height: 100px; position: relative; border: solid blue 3px;">
  70. <span id="s1">s1 text</span><br><br><br>
  71. <span id="s2">s2 text</span><br><br><br>
  72. <span id="s3">s3 text</span><br><br><br>
  73. <span id="s4">s4 text</span><br><br><br>
  74. <span id="s5">s5 text</span><br><br><br>
  75. </div>
  76. <span dojoType="dijit.Tooltip" connectId="id1">
  77. tooltip for #1<br>
  78. long&nbsp;long&nbsp;long&nbsp;long&nbsp;long&nbsp;long&nbsp;long&nbsp;long&nbsp;long&nbsp;long&nbsp;long&nbsp;text<br>
  79. make sure that this works properly with a really narrow window
  80. </span>
  81. <span dojoType="dijit.Tooltip" connectId="id2">tooltip for #2</span>
  82. <span dojoType="dijit.Tooltip" connectId="id3">tooltip for #3</span>
  83. <span dojoType="dijit.Tooltip" connectId="id4">tooltip for #4</span>
  84. <span dojoType="dijit.Tooltip" connectId="id5">tooltip for #5</span>
  85. <span dojoType="dijit.Tooltip" connectId="id6">tooltip for #6</span>
  86. <span dojoType="dijit.Tooltip" connectId="s1">s1 tooltip</span>
  87. <span dojoType="dijit.Tooltip" connectId="s2">s2 tooltip</span>
  88. <span dojoType="dijit.Tooltip" connectId="s3">s3 tooltip</span>
  89. <span dojoType="dijit.Tooltip" connectId="s4">s4 tooltip</span>
  90. <span dojoType="dijit.Tooltip" connectId="s5">s5 tooltip</span>
  91. <h3>One Tooltip for multiple connect nodes</h3>
  92. <span dojoType="dijit.Tooltip" connectId="multi1,multi2" style="display:none;">multi tooltip</span>
  93. <a id="multi1" href="#bogus">multi1</a><br><a id="multi2" href="#bogus">multi2</a>
  94. </body>
  95. </html>