1 | <!doctype html> |
---|
2 | <html> |
---|
3 | <head> |
---|
4 | <meta charset="utf-8" /> |
---|
5 | <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> |
---|
6 | <script src="//cdn.ckeditor.com/4.4.3/standard/ckeditor.js"></script> |
---|
7 | <script src="//cdn.ckeditor.com/4.4.3/standard/adapters/jquery.js"></script> |
---|
8 | <title>Test</title> |
---|
9 | </head> |
---|
10 | <body> |
---|
11 | <p><a href="#" id="move">Move CKEditor</a></p> |
---|
12 | <script> |
---|
13 | $(function(){ |
---|
14 | $('#form_text').ckeditor(); |
---|
15 | |
---|
16 | $('#move').on('click', function(e) { |
---|
17 | e.preventDefault(); |
---|
18 | if($('#first>#form').size()>0) $('#form').appendTo('#second'); |
---|
19 | else $('#form').appendTo('#first'); |
---|
20 | }); |
---|
21 | }); |
---|
22 | </script> |
---|
23 | |
---|
24 | <div id="first" style="min-height:200px;border:2px solid blue"> |
---|
25 | <form id="form"> |
---|
26 | <textarea name="form_text" id="form_text"></textarea><br /> |
---|
27 | </form> |
---|
28 | </div> |
---|
29 | <div id="second" style="min-height:200px;border:2px solid red;margin-top:1em"></div> |
---|
30 | </body> |
---|
31 | </html> |
---|