Ueditor的输入文本后,选择有序列表、无序列表样式显示的问题_百度知 ...
发布网友
发布时间:2022-04-27 04:04
我来回答
共2个回答
热心网友
时间:2022-05-13 10:52
这个样式不是用css定义的,你试着引入下载的完整源码包里面的ueditor1_4_3-src\_parse\list.js 和
ueditor1_4_3-src\_src\plugins\list.js 试试,ol的样式是通过这两个js生成的。
-------------------------------------------------------------------------------
ueditor1_4_3-src\_src\plugins\list.js 片段:
-------------------------------------------------------------------------------
me.ready(function () {
var customCss = [];
for(var p in customStyle){
if(p == 'dash' || p == 'dot'){
customCss.push('li.list-' + customStyle[p] + '{background-image:url(' + liiconpath +customStyle[p]+'.gif)}');
customCss.push('ul.custom_'+p+'{list-style:none;}ul.custom_'+p+' li{background-position:0 3px;background-repeat:no-repeat}');
}else{
for(var i= 0;i<99;i++){
customCss.push('li.list-' + customStyle[p] + i + '{background-image:url(' + liiconpath + 'list-'+customStyle[p] + i + '.gif)}')
}
customCss.push('ol.custom_'+p+'{list-style:none;}ol.custom_'+p+' li{background-position:0 3px;background-repeat:no-repeat}');
}
switch(p){
case 'cn':
customCss.push('li.list-'+p+'-paddingleft-1{padding-left:25px}');
customCss.push('li.list-'+p+'-paddingleft-2{padding-left:40px}');
customCss.push('li.list-'+p+'-paddingleft-3{padding-left:55px}');
break;
case 'cn1':
customCss.push('li.list-'+p+'-paddingleft-1{padding-left:30px}');
customCss.push('li.list-'+p+'-paddingleft-2{padding-left:40px}');
customCss.push('li.list-'+p+'-paddingleft-3{padding-left:55px}');
break;
case 'cn2':
customCss.push('li.list-'+p+'-paddingleft-1{padding-left:40px}');
customCss.push('li.list-'+p+'-paddingleft-2{padding-left:55px}');
customCss.push('li.list-'+p+'-paddingleft-3{padding-left:68px}');
break;
case 'num':
case 'num1':
customCss.push('li.list-'+p+'-paddingleft-1{padding-left:25px}');
break;
case 'num2':
customCss.push('li.list-'+p+'-paddingleft-1{padding-left:35px}');
customCss.push('li.list-'+p+'-paddingleft-2{padding-left:40px}');
break;
case 'dash':
customCss.push('li.list-'+p+'-paddingleft{padding-left:35px}');
break;
case 'dot':
customCss.push('li.list-'+p+'-paddingleft{padding-left:20px}');
}
}
customCss.push('.list-paddingleft-1{padding-left:0}');
customCss.push('.list-paddingleft-2{padding-left:'+me.options.listDefaultPaddingLeft+'px}');
customCss.push('.list-paddingleft-3{padding-left:'+me.options.listDefaultPaddingLeft*2+'px}');
//如果不给宽度会在自定应样式里出现滚动条
utils.cssRule('list', 'ol,ul{margin:0;pading:0;'+(browser.ie ? '' : 'width:95%')+'}li{clear:both;}'+customCss.join('\n'), me.document);
});