2014-12-04 101 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