gfranko / jquery.tocify.js

A jQuery Table of Contents plugin that can be themed with Twitter Bootstrap or jQueryUI.
http://gregfranko.com/jquery.tocify.js/
MIT License
928 stars 216 forks source link

External URL #83

Closed ngzhongcai-zz closed 8 years ago

ngzhongcai-zz commented 8 years ago

Is there anyway to "insert" in an external URL on another page in the tocify table of content? ie, user clicks on the table of content, and is redirected to another page defined by the

ngzhongcai-zz commented 8 years ago

Got it... Below is what I did 1) <div id="toc">Slot in your ul tags... define also the "#last" ul you want to start inserting the generated toc</div> 2) at line#260, instead of self.element.append(ul), amend it as follows: if(index== 0) { $("#last").after(ul); } else { $("#" + headerClassName + (index-1)).after(ul); }