Wat ik probeer te maken is dit:
Wat ik nu heb ik dit:
Mijn vraag is hier ik in die wrapper, boven de textarea een ubb-toolbar div kan toevoegen en daarin een unordered list (mbv jQuery functies). Ik zou die hele hap html in regel 9 erbij kunnen plempen, maar dat lijkt me niet de bedoeling. Wie kan mij op weg helpen?
HTML:
1
2
3
4
5
6
7
8
9
| <div class="ubb-container"> <div class="ubb-toolbar"> <ul> <li>button 1 <li>button 2 </ul> </div> <textarea class="ubb"></textarea> </div> |
Wat ik nu heb ik dit:
HTML:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
| <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js"></script> <script type="text/javascript"> (function($) { $.fn.ubbeditor = function(options) { return this.each(function() { obj = $(this); obj.wrap('<div class="ubb-container"</div>'); }); }; })(jQuery); </script> <script type="text/javascript"> $(document).ready(function() { $('.ubb').ubbeditor(); }); </script> </head> <body> <textarea id="one" class="ubb"></textarea> <textarea id="two" class="ubb"></textarea> </body> </html> |
Mijn vraag is hier ik in die wrapper, boven de textarea een ubb-toolbar div kan toevoegen en daarin een unordered list (mbv jQuery functies). Ik zou die hele hap html in regel 9 erbij kunnen plempen, maar dat lijkt me niet de bedoeling. Wie kan mij op weg helpen?
"Real software engineers work from 9 to 5, because that is the way the job is described in the formal spec. Working late would feel like using an undocumented external procedure."