我想要做的是創建一個工具欄,其中一些默認按鈕與左側對齊,然後將自定義按鈕/下拉對齊到同一工具欄的右側。在tinyMCE工具欄上的右側浮動按鈕
這裏是我的HTML/JavaScript的/初始化:
<h3>
Behold: Magic
</h3>
<div>
<%= text_area_tag :content, "", id: "magic", rows: 20 %>
</div>
<script type="text/javascript">
tinymce.init({
selector: "#magic",
plugins: "link image",
menubar: false,
toolbar: "bold italic underline strikethrough | styleselect | bullist numlist | undo redo | link image | insertField",
setup: function(editor) {
editor.addButton("insertField", {
type: "menubutton",
text: "Insert Field",
style: "float: right",
menu: [
{ text: "First Name", onclick: function() { editor.insertContent("tom"); } },
{ text: "Last Name", onclick: function() { editor.insertContent("prats"); } }
]
});
}
});
</script>
到目前爲止,這個代碼在這個意義上,所有的元素TinyMCE的工具欄是存在的,但還是左對齊。下面是它的外觀/應該是:
錯誤:
These | Count | As | Buttons | Floated | Left | Floated Right
右:
These | Count | As | Buttons | Floated | Left Floated Right
正如你所看到的,我想從風格添加CSS(也是班級)選項,雖然它出現在元素上,元素沒有走到右側。任何幫助,將不勝感激。