tabindex.html 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <!DOCTYPE html>
  2. <!--
  3. Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
  4. For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  5. -->
  6. <html lang="en">
  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. <meta name="description" content="Try the latest sample of CKEditor 4 and learn more about customizing your WYSIWYG editor with endless possibilities.">
  13. <style>
  14. .cke_focused,
  15. .cke_editable.cke_focused
  16. {
  17. outline: 3px dotted blue !important;
  18. *border: 3px dotted blue !important; /* For IE7 */
  19. }
  20. </style>
  21. <script>
  22. CKEDITOR.on( 'instanceReady', function( evt ) {
  23. var editor = evt.editor;
  24. editor.setData( 'This editor has it\'s tabIndex set to <strong>' + editor.tabIndex + '</strong>' );
  25. // Apply focus class name.
  26. editor.on( 'focus', function() {
  27. editor.container.addClass( 'cke_focused' );
  28. });
  29. editor.on( 'blur', function() {
  30. editor.container.removeClass( 'cke_focused' );
  31. });
  32. // Put startup focus on the first editor in tab order.
  33. if ( editor.tabIndex == 1 )
  34. editor.focus();
  35. });
  36. </script>
  37. </head>
  38. <body>
  39. <h1 class="samples">
  40. <a href="index.html">CKEditor Samples</a> &raquo; TAB Key-Based Navigation
  41. </h1>
  42. <div class="warning deprecated">
  43. 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>.
  44. </div>
  45. <div class="description">
  46. <p>
  47. This sample shows how tab key navigation among editor instances is
  48. affected by the <code>tabIndex</code> attribute from
  49. the original page element. Use TAB key to move between the editors.
  50. </p>
  51. </div>
  52. <p>
  53. <textarea class="ckeditor" cols="80" id="editor4" rows="10" tabindex="1"></textarea>
  54. </p>
  55. <div class="ckeditor" contenteditable="true" id="editor1" tabindex="4"></div>
  56. <p>
  57. <textarea class="ckeditor" cols="80" id="editor2" rows="10" tabindex="2"></textarea>
  58. </p>
  59. <p>
  60. <textarea class="ckeditor" cols="80" id="editor3" rows="10" tabindex="3"></textarea>
  61. </p>
  62. <div id="footer">
  63. <hr>
  64. <p>
  65. CKEditor - The text editor for the Internet - <a class="samples" href="https://ckeditor.com/">https://ckeditor.com</a>
  66. </p>
  67. <p id="copy">
  68. Copyright &copy; 2003-2023, <a class="samples" href="https://cksource.com/">CKSource</a> Holding sp. z o.o. All rights reserved.
  69. </p>
  70. </div>
  71. </body>
  72. </html>