问题
I have a website where bullets are automatically hidden in list elements
<ul>
<li>aSASa</li>
<li>ASDDAS</li>
<li>SADASD</li>
</ul>
Now I wonder if it's possible when adding a bullet using TinyMCE to automatically add a class on inline style to the list element that will enable bullts to show eg.
insteas of just adding <ul>
timnymce should add <ul style="list-style-type:circle;">
回答1:
Yes this is possible. You will need to figure out on what event you will do the following action (either using the setup tinymce init parameter or an own plugin):
$(editor.getBody()).find('ul').css('list-style-type','circle');
Example using the setup parameter and the onKeyUp event:
setup : function(ed) {
ed.onKeyUp.add(function(ed, evt) {
$(ed.getBody()).find('ul').css('list-style-type','circle');
});
},
来源:https://stackoverflow.com/questions/7986473/tinymce-when-adding-bullets-the-bullets-do-not-show-in-front-end-view