tabindex.html 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <!DOCTYPE html>
  2. <!--
  3. Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
  4. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  5. -->
  6. <html>
  7. <head>
  8. <meta charset="utf-8">
  9. <title>TAB Key-Based Navigation &mdash; CKEditor Sample</title>
  10. <script src="../../ckeditor.js"></script>
  11. <link href="sample.css" rel="stylesheet">
  12. <style>
  13. .cke_focused,
  14. .cke_editable.cke_focused
  15. {
  16. outline: 3px dotted blue !important;
  17. *border: 3px dotted blue !important; /* For IE7 */
  18. }
  19. </style>
  20. <script>
  21. CKEDITOR.on( 'instanceReady', function( evt ) {
  22. var editor = evt.editor;
  23. editor.setData( 'This editor has it\'s tabIndex set to <strong>' + editor.tabIndex + '</strong>' );
  24. // Apply focus class name.
  25. editor.on( 'focus', function() {
  26. editor.container.addClass( 'cke_focused' );
  27. });
  28. editor.on( 'blur', function() {
  29. editor.container.removeClass( 'cke_focused' );
  30. });
  31. // Put startup focus on the first editor in tab order.
  32. if ( editor.tabIndex == 1 )
  33. editor.focus();
  34. });
  35. </script>
  36. </head>
  37. <body>
  38. <h1 class="samples">
  39. <a href="index.html">CKEditor Samples</a> &raquo; TAB Key-Based Navigation
  40. </h1>
  41. <div class="warning deprecated">
  42. This sample is not maintained anymore. Check out its <a href="https://ckeditor.com/docs/ckeditor4/latest/examples/tabindex.html">brand new version in CKEditor Examples</a>.
  43. </div>
  44. <div class="description">
  45. <p>
  46. This sample shows how tab key navigation among editor instances is
  47. affected by the <code>tabIndex</code> attribute from
  48. the original page element. Use TAB key to move between the editors.
  49. </p>
  50. </div>
  51. <p>
  52. <textarea class="ckeditor" cols="80" id="editor4" rows="10" tabindex="1"></textarea>
  53. </p>
  54. <div class="ckeditor" contenteditable="true" id="editor1" tabindex="4"></div>
  55. <p>
  56. <textarea class="ckeditor" cols="80" id="editor2" rows="10" tabindex="2"></textarea>
  57. </p>
  58. <p>
  59. <textarea class="ckeditor" cols="80" id="editor3" rows="10" tabindex="3"></textarea>
  60. </p>
  61. <div id="footer">
  62. <hr>
  63. <p>
  64. CKEditor - The text editor for the Internet - <a class="samples" href="https://ckeditor.com/">https://ckeditor.com</a>
  65. </p>
  66. <p id="copy">
  67. Copyright &copy; 2003-2019, <a class="samples" href="https://cksource.com/">CKSource</a> - Frederico
  68. Knabben. All rights reserved.
  69. </p>
  70. </div>
  71. </body>
  72. </html>