질문/답변
TOC/ 목차에서 소제목이 제대로 생성이 안됩니다
* 한 줄 무성의 게시글은 무통보 삭제 됩니다.
도와주세요~~
소제목 작성한거는 3개인대 1개만 나오고 어떤경우는 작성 소제목은 4개인대 3개, 점은 4개 찍히는대 소제목은 3개만 나오고
포스팅마다 다 디죽박죽입니다
무엇이 잘못된걸까요?
#1 스킨입니다.
<script src="./images/jquery.toc.min.js"></script>
<script>
// 목차 생성
$(document).ready(function() {
var $toc = $("#toc");
if($toc.length == 0) {
var firstContent = $('.tt_article_useless_p_margin').children().eq(0);
var titleLength = $('.tt_article_useless_p_margin h2,h3,h4').length - $('.another_category h4').length - $('h3.tit_list_type').length;
if(titleLength > 0 && firstContent.length > 0) {
firstContent.before('<div class="book-toc"><p>목차</p><ul id="toc"></ul></div>');
$toc = $("#toc");
}
}
if($toc.length > 0) {
$toc.toc({content: ".tt_article_useless_p_margin", headings: "h2,h3,h4"});
if($('.another_category').length > 0) {
$toc.find('li:last').remove();
}
}
});
</script>
댓글
댓글 로딩 중...