| 1 | <!doctype html> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <meta charset="utf-8"> |
| 5 | <meta name="viewport" content="width=device-width, initial-scale=1"> |
| 6 | <title>jQuery UI Tooltip - Forms</title> |
| 7 | <link rel="stylesheet" href="../../themes/base/all.css"> |
| 8 | <link rel="stylesheet" href="../demos.css"> |
| 9 | <style> |
| 10 | label { |
| 11 | display: inline-block; width: 5em; |
| 12 | } |
| 13 | fieldset div { |
| 14 | margin-bottom: 2em; |
| 15 | } |
| 16 | fieldset .help { |
| 17 | display: inline-block; |
| 18 | } |
| 19 | .ui-tooltip { |
| 20 | width: 210px; |
| 21 | } |
| 22 | </style> |
| 23 | <script src="../../external/requirejs/require.js"></script> |
| 24 | <script src="../bootstrap.js" data-modules="button"> |
| 25 | var tooltips = $( "[title]" ).tooltip({ |
| 26 | position: { |
| 27 | my: "left top", |
| 28 | at: "right+5 top-5", |
| 29 | collision: "none" |
| 30 | } |
| 31 | }); |
| 32 | $( "<button>" ) |
| 33 | .text( "Show help" ) |
| 34 | .button() |
| 35 | .on( "click", function() { |
| 36 | tooltips.tooltip( "open" ); |
| 37 | }) |
| 38 | .insertAfter( "form" ); |
| 39 | </script> |
| 40 | </head> |
| 41 | <body> |
| 42 | |
| 43 | <form> |
| 44 | <fieldset> |
| 45 | <div> |
| 46 | <label for="firstname">Firstname</label> |
| 47 | <input id="firstname" name="firstname" title="Please provide your firstname."> |
| 48 | </div> |
| 49 | <div> |
| 50 | <label for="lastname">Lastname</label> |
| 51 | <input id="lastname" name="lastname" title="Please provide also your lastname."> |
| 52 | </div> |
| 53 | <div> |
| 54 | <label for="address">Address</label> |
| 55 | <input id="address" name="address" title="Your home or work address."> |
| 56 | </div> |
| 57 | </fieldset> |
| 58 | </form> |
| 59 | |
| 60 | <div class="demo-description"> |
| 61 | <p>Use the button below to display the help texts, or just focus or mouseover the indivdual inputs.</p> |
| 62 | <p>A fixed width is defined in CSS to make the tooltips look consistent when displayed all at once.</p> |
| 63 | </div> |
| 64 | </body> |
| 65 | </html> |