PageRenderTime 50ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/node_modules/materialize-css/jade/page-contents/dialogs_content.html

https://gitlab.com/maudebo/tp-maudebaillyotis1
HTML | 134 lines | 111 code | 20 blank | 3 comment | 0 complexity | a947e8e48cb01fda4037c0c44b983799 MD5 | raw file
  1. <div class="container">
  2. <div class="row">
  3. <div class="col s12 m9 l10">
  4. <div id="toast" class="section scrollspy">
  5. <p class="caption">Dialogs are content that are not originally visible on a page but show up with extra information if needed. The transitions should make the appearance of the dialog make sense and not jarring to the user.</p>
  6. <h2 class="header">Toasts</h2>
  7. <p>Materialize provides an easy way for you to send unobtrusive alerts to your users through toasts. These toasts are also placed and sized responsively, try it out by clicking the button below on different device sizes.</p>
  8. <a class="waves-effect waves-light btn" onclick="Materialize.toast('I am a toast', 4000)">Toast!</a>
  9. <p>To do this, call the Materialize.toast() function programatically in JavaScript.</p>
  10. <pre><code class="language-javascript">
  11. // Materialize.toast(message, displayLength, className, completeCallback);
  12. Materialize.toast('I am a toast!', 4000) // 4000 is the duration of the toast
  13. </code></pre>
  14. <p>One way to add this into your application is to add this as an onclick event to a button</p>
  15. <pre><code class="language-markup">
  16. &lt;a class="btn" onclick="Materialize.toast('I am a toast', 4000)">Toast!&lt;/a>
  17. </code></pre>
  18. <h4>Custom HTML</h4>
  19. <p>You can pass in an HTML String as the first argument as well. Take a look at the example below, where we pass in text as well as a flat button. If you call an external function instead of in-line JavaScript, you will not need to escape quotation marks. </p>
  20. <a class="waves-effect waves-light btn" onclick="displayCustomHTMLToast()">Toast with Action</a>
  21. <pre><code class="language-javascript">
  22. var $toastContent = $('&lt;span>I am toast content&lt;/span>');
  23. Materialize.toast($toastContent, 5000);
  24. </code></pre>
  25. <h4>Callback</h4>
  26. <p>You can have the toast callback a function when it has been dismissed</p>
  27. <a class="btn" onclick="Materialize.toast('I am a toast', 4000,'',function(){alert('Your toast was dismissed')})">Toast!</a>
  28. <pre><code class="language-markup">
  29. &lt;a class="btn" onclick="Materialize.toast('I am a toast', 4000,'',function(){alert('Your toast was dismissed')})">Toast!&lt;/a>
  30. </code></pre>
  31. <h4>Styling Toasts</h4>
  32. <p>We've added the ability to customize your toasts easily. You can pass in classes as an optional parameter into the toast function. We've added a rounded class for you, but you can create your own CSS classes and apply them to toasts. Checkout out our full example below.</p>
  33. <a class="waves-effect waves-light btn" onclick="Materialize.toast('I am a toast!', 3000, 'rounded')">Round Toast!</a>
  34. <pre><code class="language-javascript">
  35. Materialize.toast('I am a toast!', 3000, 'rounded') // 'rounded' is the class I'm applying to the toast
  36. </code></pre>
  37. </div>
  38. <!-- Tooltip Section -->
  39. <div id="tooltip" class="scrollspy section">
  40. <h2 class="header">Tooltips</h2>
  41. <p>Tooltips are small, interactive, textual hints for mainly graphical elements. When using icons for actions you can use a tooltip to give people clarification on its function.</p>
  42. <div class="row">
  43. <a class="btn tooltipped col s4 offset-s4 l2 offset-l1" data-html="true" data-position="bottom" data-delay="50" data-tooltip="I am tooltip"> Bottom</a>
  44. <a class="btn tooltipped col s4 offset-s4 l2 offset-l1" data-position="top" data-delay="50" data-tooltip="I am tooltip"> Top</a>
  45. <a class="btn tooltipped col s4 offset-s4 l2 offset-l1" data-position="left" data-delay="50" data-tooltip="I am tooltip"> Left</a>
  46. <a class="btn tooltipped col s4 offset-s4 l2 offset-l1" data-position="right" data-delay="50" data-tooltip="I am tooltip"> Right</a>
  47. </div>
  48. <p>Add the Tooltipped class to your element and add either top, bottom, left, right on data-tooltip to control the position.</p>
  49. <pre><code class="language-markup">
  50. &lt;!-- data-position can be : bottom, top, left, or right -->
  51. &lt;!-- data-delay controls delay before tooltip shows (in milliseconds)-->
  52. &lt;a class="btn tooltipped" data-position="bottom" data-delay="50" data-tooltip="I am tooltip">Hover me!&lt;/a>
  53. </code></pre>
  54. <br>
  55. <h4>Initialization</h4>
  56. <p>Tooltips are initialized automatically, but if you have dynamically added tooltips, you will need to initialize them.</p>
  57. <pre><code class="language-javascript">
  58. $(document).ready(function(){
  59. $('.tooltipped').tooltip({delay: 50});
  60. });
  61. </code></pre><br>
  62. <h4>jQuery Plugin Options</h4>
  63. <table class="highlight">
  64. <thead>
  65. <tr>
  66. <th>Option Name</th>
  67. <th>Description</th>
  68. </tr>
  69. </thead>
  70. <tbody>
  71. <tr>
  72. <td>delay</td>
  73. <td>Delay time before tooltip appears. (Default: 350)</td>
  74. </tr>
  75. <tr>
  76. <td>tooltip</td>
  77. <td>Tooltip text. Can use custom HTML if you set the html option.</td>
  78. </tr>
  79. <tr>
  80. <td>position</td>
  81. <td>Set the direction of the tooltip. 'top', 'right', 'bottom', 'left'. (Default: 'bottom')</td>
  82. </tr>
  83. <tr>
  84. <td>html</td>
  85. <td>Allow custom html inside the tooltip. (Default: false)</td>
  86. </tr>
  87. </tbody>
  88. </table>
  89. <br />
  90. <h4>Removal</h4>
  91. <p>To remove the tooltip from the button, pass in <code class="language-javascript">'remove'</code> as the option to the tooltip function</p>
  92. <pre><code class="language-javascript">
  93. // This will remove the tooltip functionality for the buttons on this page
  94. $('.tooltipped').tooltip('remove');
  95. </code></pre>
  96. </div>
  97. </div>
  98. <!-- Table of Contents -->
  99. <div class="col hide-on-small-only m3 l2">
  100. <div class="toc-wrapper">
  101. <div class="buysellads hide-on-small-only">
  102. <!-- CarbonAds Zone Code -->
  103. <script async type="text/javascript" src="//cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=materializecss" id="_carbonads_js"></script>
  104. </div>
  105. <div style="height: 1px;">
  106. <ul class="section table-of-contents">
  107. <li><a href="#toast">Toasts</a></li>
  108. <li><a href="#tooltip">Tooltips</a></li>
  109. </ul>
  110. </div>
  111. </div>
  112. </div>
  113. </div>
  114. </div>