Last active
August 29, 2015 14:22
-
-
Save vjsingh/c84cd22ac40247c2b1f1 to your computer and use it in GitHub Desktop.
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
var ToC = "<nav role='navigation' class='table-of-contents'>" + | |
"<h2>Upcoming Events and Classes:</h2>" + | |
"<ul>"; | |
var el, title, link; | |
$(".a-header").each(function() { | |
el = $(this); | |
title = el.text(); | |
link = "#" + el.attr("id"); | |
newLine = "<li>" + | |
"<a href='" + link + "'>" + | |
title + | |
"</a>" + | |
"</li>"; | |
ToC += newLine; | |
}); | |
ToC += "</ul>" + | |
"</nav>"; | |
$(".whole-page").prepend(ToC); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment