Speed dial readme script


SUBMITTED BY: erictibby

DATE: Feb. 27, 2017, 9:26 a.m.

FORMAT: Text only

SIZE: 4.9 kB

HITS: 26408

  1. This plugin adds a Speed Dial component to any project using MDL.
  2. MDL doesn't include a Speed Dial component (the FAB-based menu) by default, so this plugin can be used to add that missing element to your project.
  3. ## [Demo](http://nesgael.github.io/mdl-speed-dial/)
  4. ## How to use it
  5. You can place your speed dial in two different places: at the right-bottom corner of the page and in the edge of the header/navbar.
  6. #### Right-bottom corner placed
  7. Use the `.mdl-speed-dial--bottom-fixed` class.
  8. ```html
  9. <div class="mdl-speed-dial mdl-speed-dial--bottom-fixed">
  10. <div class="mdl-speed-dial__options">
  11. <div class="mdl-speed-dial__option">
  12. <p class="mdl-speed-dial__tooltip">Option 3</p>
  13. <a href="#" class="mdl-button mdl-js-button mdl-button--fab mdl-button--mini-fab">
  14. <i class="material-icons">folder</i>
  15. </a>
  16. </div>
  17. <div class="mdl-speed-dial__option">
  18. <p class="mdl-speed-dial__tooltip">Option 2</p>
  19. <a href="#" class="mdl-button mdl-js-button mdl-button--fab mdl-button--mini-fab">
  20. <i class="material-icons">attach_file</i>
  21. </a>
  22. </div>
  23. <div class="mdl-speed-dial__option">
  24. <p class="mdl-speed-dial__tooltip">Option 1</p>
  25. <a href="#" class="mdl-button mdl-js-button mdl-button--fab mdl-button--mini-fab">
  26. <i class="material-icons">email</i>
  27. </a>
  28. </div>
  29. </div>
  30. <!-- Be sure to put the .mdl-speed-dial__main-fab button after the .mdl-speed-dial__options section -->
  31. <button class="mdl-speed-dial__main-fab mdl-speed-dial__main-fab--spin mdl-button mdl-js-button mdl-button--fab mdl-js-ripple-effect mdl-button--colored">
  32. <i class="material-icons mdl-speed-dial_main-fab-icon mdl-speed-dial_main-fab-icon--primary">add</i>
  33. <i class="material-icons mdl-speed-dial_main-fab-icon mdl-speed-dial_main-fab-icon--secondary">create</i>
  34. </button>
  35. </div>
  36. ```
  37. ### Header edge placed
  38. Put the code inside the ```<header>``` element, as a direct child.
  39. Use the `.mdl-speed-dial--header-edge` class.
  40. ```html
  41. <div class="mdl-speed-dial mdl-speed-dial--header-edge">
  42. <!-- Be sure to put the .mdl-speed-dial__main-fab button before the .mdl-speed-dial__options section -->
  43. <button class="mdl-speed-dial__main-fab mdl-button mdl-js-button mdl-button--fab mdl-js-ripple-effect mdl-button--colored">
  44. <i class="material-icons mdl-speed-dial_main-fab-icon">add</i>
  45. </button>
  46. <div class="mdl-speed-dial__options">
  47. <div class="mdl-speed-dial__option">
  48. <p class="mdl-speed-dial__tooltip">Option 1</p>
  49. <a href="#" class="mdl-button mdl-js-button mdl-button--fab mdl-button--mini-fab">
  50. <i class="material-icons">folder</i>
  51. </a>
  52. </div>
  53. <div class="mdl-speed-dial__option">
  54. <p class="mdl-speed-dial__tooltip">Option 2</p>
  55. <a href="#" class="mdl-button mdl-js-button mdl-button--fab mdl-button--mini-fab">
  56. <i class="material-icons">attach_file</i>
  57. </a>
  58. </div>
  59. <div class="mdl-speed-dial__option">
  60. <p class="mdl-speed-dial__tooltip">Option 3</p>
  61. <a href="#" class="mdl-button mdl-js-button mdl-button--fab mdl-button--mini-fab">
  62. <i class="material-icons">create</i>
  63. </a>
  64. </div>
  65. </div>
  66. </div>
  67. ```
  68. ## Options
  69. <table>
  70. <thead>
  71. <tr>
  72. <th>Modifier Class</th>
  73. <th>Description</th>
  74. </tr>
  75. </head>
  76. <tbody>
  77. <tr>
  78. <td>.mdl-speed-dial--bottom-fixed</td>
  79. <td>Place the speed dial at the right-bottom corner of the page.</td>
  80. </tr>
  81. <tr>
  82. <td>.mdl-speed-dial--header-edge</td>
  83. <td>Place the speed dial at the edge of the header/navbar.</td>
  84. </tr>
  85. <tr>
  86. <td>.mdl-speed-dial__tooltip--hidden</td>
  87. <td>Hide the tooltip of the FAB option element and show it only when hover.</td>
  88. </tr>
  89. <tr>
  90. <td>.mdl-speed-dial__main-fab--spin</td>
  91. <td>Rotate the main FAB when hover.</td>
  92. </tr>
  93. <tr>
  94. <td class="mdl-data-table__cell--non-numeric"><code>.mdl-speed-dial_main-fab-icon--primary</code></td>
  95. <td class="mdl-data-table__cell--non-numeric">Use this modifier when you want to switch between two icons when hover and un-hover the main FAB. Add the class to the primary icon (shown on un-hover state) inside the <code>.mdl-speed-dial__main-fab</code> element.</td>
  96. </tr>
  97. <tr>
  98. <td class="mdl-data-table__cell--non-numeric"><code>.mdl-speed-dial_main-fab-icon--secondary</code></td>
  99. <td class="mdl-data-table__cell--non-numeric">Use this modifier when you want to switch between two icons when hover and un-hover the main FAB. Add the class to the secondary icon (shown on hover state) inside the <code>.mdl-speed-dial__main-fab</code> element.</td>
  100. </tr>
  101. </tbody>
  102. </table>
  103. You can see examples of the usage of these options in the previous section ("How to use it")
  104. ## Dependencies
  105. The only dependency is jQuery (besides MDL).

comments powered by Disqus