auto-height.html 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>Auto height - Editor.md examples</title>
  6. <link rel="stylesheet" href="css/style.css" />
  7. <link rel="stylesheet" href="../css/editormd.css" />
  8. <link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" />
  9. </head>
  10. <body>
  11. <div id="layout">
  12. <header>
  13. <h1>Auto height test</h1>
  14. </header>
  15. <div class="btns">
  16. <button id="append-btn">Append markdown</button>
  17. </div>
  18. <div id="test-editormd">
  19. <textarea style="display:none;">### Settings
  20. ```javascript
  21. var testEditor = editormd("test-editormd", {
  22. autoHeight : true
  23. });
  24. ```
  25. </textarea>
  26. </div>
  27. </div>
  28. <script src="js/jquery.min.js"></script>
  29. <script src="../editormd.js"></script>
  30. <script type="text/javascript">
  31. var testEditor;
  32. $(function() {
  33. testEditor = editormd("test-editormd", {
  34. width : "90%",
  35. autoHeight : true,
  36. path : "../lib/",
  37. htmlDecode : "style,script,iframe",
  38. tex : true,
  39. emoji : true,
  40. taskList : true,
  41. flowChart : true,
  42. sequenceDiagram : true
  43. });
  44. $("#append-btn").click(function(){
  45. $.get("./test.md", function(md){
  46. testEditor.appendMarkdown(md);
  47. });
  48. });
  49. });
  50. </script>
  51. </body>
  52. </html>