2014-12-04 74 views
0

我想修改的CKEditor的了Horizo​​ntalRule插件:使用Javascript - 創建元素<hr>與內嵌樣式

... 
exec: function(editor) { 
     var hr = editor.document.createElement('hr'); 
     editor.insertElement(hr); 
    }, 

    allowedContent: 'hr', 
    requiredContent: 'hr' 
}; 
... 

此插件生成:

<hr /> 

但我想獲得SG。像:

<hr style="color:#FFF; height:2px;" /> 

任何人都可以幫我解決這個問題嗎?

回答

1
hr.style.color = "#FFF"; 
hr.style.height = "2px"; 

您幾乎可以隨時對hr變量這樣做。

+0

我試過這個allready,但它不工作。這似乎是ckeditor的一個具體問題 – user2987790 2014-12-04 16:55:07