提交 2c37e9fd 编写于 作者: C Catouse

* fix ol padding with js.

上级 23771723
/* ========================================================================
* ZUI: typography.js
* http://zui.sexy
* ========================================================================
* Copyright (c) 2014-2016 cnezsoft.com; Licensed MIT
* ======================================================================== */
(function($) {
'use strict';
$.fn.fixOlPd = function(pd) {
pd = pd || 10;
return this.each(function() {
var $ol = $(this);
$ol.css('paddingLeft', Math.ceil(Math.log10($ol.children().length)) * pd + 10);
});
};
$(function() {
$('.ol-pd-fix,.article ol').fixOlPd();
});
}(jQuery));
......@@ -261,3 +261,8 @@ blockquote {
}
}
}
// fix OL padding
.ol-pd-2 {padding-left: 40px;}
.ol-pd-3 {padding-left: 60px;}
.ol-pd-4 {padding-left: 80px;}
......@@ -185,7 +185,8 @@
"typography.basic": {
"name": "基本排版",
"src": {
"less": ["~/controls/type.less"]
"less": ["~/controls/type.less"],
"js": ["~/typography.js"]
},
"ver": "1.0.0",
"source": "Bootstrap",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册