Closed prasad83 closed 8 years ago
Consider the http://site.tld/page is being viewed and is configured.
TOC link <a href="#inside-page"> would result to http://site.tld#inside-page - WRONG.
Having options... base would be good.
$("<li/>").appendTo(stack[0]).append( $("<a/>").text(elem.text()).attr("href", (thisOptions.base ? thisOptions.base : '') + "#" + elem.attr("id")); );
In the example page stated above, I would use
jQuery('#toc').toc({base: '/page'});
This isn't an issue with this library, per se.
You can easily handle this case with some code like this:
jQuery("#toc").toc().find("a").attr("href", function (i, a) { return "/page" + a; });
Consider the http://site.tld/page is being viewed and is configured.
TOC link <a href="#inside-page"> would result to http://site.tld#inside-page - WRONG.
Having options... base would be good.
In the example page stated above, I would use