toolbar-auto-fixed.html 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>Toolbar auto fixed - 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" style="height:3000px;">
  12. <header>
  13. <h1>工具栏自动固定定位的开启与禁用</h1>
  14. <p>Enable / disable toolbar auto fixed position.</p>
  15. </header>
  16. <div class="btns">
  17. <button id="enable-btn">Enable</button>
  18. <button id="disable-btn">Disable</button>
  19. </div>
  20. <div id="test-editormd">
  21. <textarea style="display:none;">### Hello world!
  22. codemirror
  23. In-browser code editor
  24. codemirror 6291 3 days ago
  25. angular-ui-codemirror
  26. This directive allows you to add CodeMirror to your textarea elements.
  27. angular-ui 174 6 weeks ago
  28. share-codemirror
  29. Codemirror bindings for ShareJS
  30. share 24 3 months ago
  31. requirejs-codemirror
  32. Load codemirror with needed modes and appending codemirror's css only when needed
  33. tuchk4 14 2 months ago
  34. codemirror-interactive-numbers
  35. Drag and update literal numbers inside codemirror
  36. fullstackio 4 17 months ago
  37. cm-searchbox
  38. CodeMirror addon for search and replace
  39. coderaiser 3 4 days ago
  40. ng-codemirror-dictionary-hint
  41. Angular directive that adds hint support to a Codemirror instance based on a custom dictionary.
  42. amarnus 3 3 months ago
  43. opentok-editor
  44. A real time collaborative editor for OpenTok using CodeMirror and ot.js
  45. aullman 3 2 weeks ago
  46. cirru-mode
  47. Cirru mode for CodeMorror
  48. Cirru 2 12 months ago
  49. ckeditor-codemirror
  50. A bower wrapper for the ckeditor codemirror plugin
  51. friedolinfoerder 1 2 weeks ago
  52. cm-show-invisibles
  53. Addon for CodeMirror that helps to show invisibles.
  54. coderaiser 1 6 days ago
  55. angular-codemirror
  56. Add CodeMirror to your AngularJS app
  57. chouseknecht 0 12 months ago
  58. codemirror-chord
  59. Codemirror mode for guitar chords
  60. zabudipar 0 3 weeks ago
  61. codemirror-states
  62. Export and import CodeMirror line classes, line widgets and markers
  63. lusever 0 12 days ago
  64. ember-cli-codemirror-shim
  65. ES6 module shim for CodeMirror.
  66. IvyApp 0 3 months ago
  67. ivy-codemirror
  68. Shim repository for ivy-codemirror.
  69. IvyApp 0 2 months ago
  70. ng-codemirror
  71. Allows you to integrate AngularJS and Codemirror with compatibility for RequireJS 2.x.
  72. VictorQueiroz 0 4 months ago
  73. sml-codemirror-mode
  74. Bower Distribution of the Sparqlification Mapping Language (SML) Syntax Highlighting Mode for CodeMirror
  75. </textarea>
  76. </div>
  77. </div>
  78. <script src="js/jquery.min.js"></script>
  79. <script src="../editormd.js"></script>
  80. <script type="text/javascript">
  81. var testEditor;
  82. $(function() {
  83. testEditor = editormd("test-editormd", {
  84. width : "90%",
  85. height : 1600,
  86. path : "../lib/"
  87. });
  88. $("#enable-btn").bind("click", function() {
  89. testEditor.setToolbarAutoFixed(true);
  90. // or
  91. //testEditor.config("toolbarAutoFixed", true);
  92. });
  93. $("#disable-btn").bind("click", function() {
  94. testEditor.setToolbarAutoFixed(false);
  95. // or
  96. //testEditor.config("toolbarAutoFixed", false);
  97. });
  98. });
  99. </script>
  100. </body>
  101. </html>