positions.html 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
  6. <title>Pikaday alignment example</title>
  7. <meta name="author" content="Maxime Thirouin">
  8. <link rel="stylesheet" href="../css/pikaday.css">
  9. <link rel="stylesheet" href="../css/site.css">
  10. </head>
  11. <body>
  12. <a href="https://github.com/dbushell/Pikaday"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
  13. <h1>Pikaday alignement example</h1>
  14. <p class="large">A refreshing JavaScript Datepicker — lightweight, no dependencies, modular CSS.</p>
  15. <label for="datepicker">Dates:</label>
  16. <br />
  17. <input type="text" id="datepicker" value="Default (bottom left)">
  18. <br />
  19. <input type="text" id="datepicker-topleft" value="Top left (waat?)"> <b>not really (too close from top)</b>
  20. <br />
  21. <input type="text" id="datepicker-topleft-forreal" value="Top left"> for real this time (same code as above)
  22. <br />
  23. <input type="text" id="datepicker-topright" value="Top right (waat?)"> <b>not really (too close from right)</b>
  24. <br />
  25. Here is the top right position with content before (no automatic adjustment used, same code as above) <input type="text" id="datepicker-topright-forreal" value="Top right">
  26. <br />
  27. <input type="text" id="datepicker-bottomright" value="Bottom right (waat?)">
  28. <br />
  29. <input type="text" id="datepicker-bottomright-forced" value="forced to position outside viewport">
  30. <br />
  31. Here is the bottom right position with content before (no automatic adjustment used, , same code as above) <input type="text" id="datepicker-bottomright-forreal" value="Bottom right">
  32. <p><i>Also, take a look to the bottom right of this page to see an example with position automatically adjusted.</i></p>
  33. <input type="text" id="datepicker-auto" style="position: absolute; bottom: 0; right: 0;" value="Automatic position">
  34. <h2>What is this?</h2>
  35. <p>Since version 1.0 Pikaday is a stable and battle tested date-picker. Feel free to use it however you like but please report any bugs or feature requests to the <a href="https://github.com/dbushell/Pikaday/issues">GitHub issue tracker</a>, thanks!</p>
  36. <p class="small">Copyright © 2014 <a href="http://dbushell.com/">David Bushell</a> | BSD &amp; MIT license | Example by <a href="https://github.com/MoOx">MoOx</a></p>
  37. <script src="../pikaday.js"></script>
  38. <script>
  39. // default: bottom left
  40. new Pikaday(
  41. {
  42. field: document.getElementById('datepicker')
  43. });
  44. new Pikaday(
  45. {
  46. field: document.getElementById('datepicker-topleft'),
  47. position: 'top left'
  48. });
  49. new Pikaday(
  50. {
  51. field: document.getElementById('datepicker-topleft-forreal'),
  52. position: 'top left'
  53. });
  54. new Pikaday(
  55. {
  56. field: document.getElementById('datepicker-topright'),
  57. position: 'top right'
  58. });
  59. new Pikaday(
  60. {
  61. field: document.getElementById('datepicker-topright-forreal'),
  62. position: 'top right'
  63. });
  64. new Pikaday(
  65. {
  66. field: document.getElementById('datepicker-bottomright'),
  67. position: 'bottom right'
  68. });
  69. new Pikaday(
  70. {
  71. field: document.getElementById('datepicker-bottomright-forced'),
  72. position: 'bottom right',
  73. reposition: false
  74. });
  75. new Pikaday(
  76. {
  77. field: document.getElementById('datepicker-bottomright-forreal'),
  78. position: 'bottom right'
  79. });
  80. new Pikaday(
  81. {
  82. field: document.getElementById('datepicker-auto'),
  83. });
  84. </script>
  85. </body>
  86. </html>