You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
656 B
JavaScript

function getTocData(){
var root = $('#toc>ul');
var data = {};
var temp = data;
function getData(dom){
var data = [];
dom.find('>li').each((key, item) => {
});
}
}
$(function(){
//对于目录树的操作
if($('#toc').length > 0){
$('#toc .toctitle').append('<span class="tocmode">&nbsp;[<a role="button" tabindex="1" class="modetogglelink" style="color: #aaa">切换</a>]&nbsp;</span>');
$('#toc ul').addClass('subtoc');
$('#toc>ul:first').removeClass('subtoc');
$('#toc .tocmode').click(function(){
alert('还没写好呢,再等等吧');
});
}
});