init_on_button.html 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0" />
  6. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css">
  7. <link rel="stylesheet" href="../../css/froala_editor.css">
  8. <link rel="stylesheet" href="../../css/froala_style.css">
  9. <style>
  10. body {
  11. text-align: center;
  12. }
  13. div#editor {
  14. width: 81%;
  15. margin: auto;
  16. text-align: left;
  17. }
  18. </style>
  19. </head>
  20. <body>
  21. <div id="editor">
  22. <h1>Init On Button</h1>
  23. <p>It is possible to initialize the WYSIWYG HTML editor only on a button.</p>
  24. <button id='edit'>Button</button>
  25. </div>
  26. <script type="text/javascript" src="../../js/froala_editor.min.js"></script>
  27. <script type="text/javascript" src="../../js/plugins/edit_in_popup.min.js"></script>
  28. <script>
  29. const editorInstance = new FroalaEditor('#edit', {
  30. events: {
  31. contentChanged: function () {
  32. console.log('content changed')
  33. }
  34. }
  35. })
  36. </script>
  37. </body>
  38. </html>