onresize.html 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>Onresize - 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>Onresize event handle</h1>
  14. <p>Plaese press F12, open the develop tools.</p>
  15. </header>
  16. <div id="test-editormd">
  17. <textarea style="display:none;">#### Settings
  18. ```javascript
  19. {
  20. onresize : function() {
  21. // console.log("onresize =>", this, this.id, this.settings);
  22. }
  23. }
  24. ```
  25. state.loaded
  26. > bind onresize event
  27. > window.onresize, editormd watch/unwatch/fullscreen/fullscreenExit/toolbar show|hide
  28. > trigger onresize event handle</textarea>
  29. </div>
  30. </div>
  31. <script src="js/jquery.min.js"></script>
  32. <script src="../editormd.js"></script>
  33. <script type="text/javascript">
  34. $(function() {
  35. var testEditor = editormd("test-editormd", {
  36. width : "90%",
  37. height : 720,
  38. path : '../lib/',
  39. onresize : function() {
  40. this.setMarkdown("state.loaded > bind onresize > window.onresize, editormd watch/unwatch/fullscreen/fullscreenExit/toolbar show|hide " + (new Date).getTime());
  41. console.log("onresize =>", this, this.id, this.settings);
  42. }
  43. });
  44. });
  45. </script>
  46. </body>
  47. </html>