2011-02-24 33 views

回答

3

添加自己的按鈕在TinyMCE的網站相當不錯描述的任何準備:http://tinymce.moxiecode.com/tryit/custom_toolbar_button.php

從網站上粘貼:

tinyMCE.init({ 
    mode : "textareas", 
    theme : "advanced", 
    theme_advanced_buttons1 : "mybutton,bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink", 
    theme_advanced_buttons2 : "", 
    theme_advanced_buttons3 : "", 
    theme_advanced_toolbar_location : "top", 
    theme_advanced_toolbar_align : "left", 
    theme_advanced_statusbar_location : "bottom", 
    plugins : 'inlinepopups', 
    setup : function(ed) { 
     // Add a custom button 
     ed.addButton('mybutton', { 
      title : 'My button', 
      image : 'img/example.gif', 
      onclick : function() { 
       // Add you own code to execute something on click 
       ed.focus(); 
       ed.selection.setContent('Hello world!'); 
      } 
     }); 
    } 
}); 

只要你改變這一點。

+0

+1這就是要走的路 – Thariama 2011-02-24 09:36:15

+0

非常感謝你 – ahmedsafan86 2011-02-24 13:39:26