Last active
February 10, 2019 10:55
-
-
Save AlekVolsk/27fe40fcc30b9edb087a125d67cda493 to your computer and use it in GitHub Desktop.
Нестандартная нумерация списков, когда номер доолжен начинаться не с 1, <ol start="num">...</ol>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ol { | |
counter-reset: list+N; /* here N = value at which to start numbering – 1 */ | |
} | |
ol > li { | |
position: relative; | |
list-style-type: none; | |
} | |
ol > li:before { | |
position: absolute; | |
content: counter(list); | |
counter-increment: list; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($) { | |
$('ol').each(function(){ | |
var attr = parseInt($(this).attr('start')); | |
if (attr !== undefined && attr != 1) { | |
$(this).css('counter-reset','list+'+(attr-1)); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment