Line 7: | Line 7: | ||
//Reposition TOC in DOM | //Reposition TOC in DOM | ||
$toc.detach(); | $toc.detach(); | ||
+ | /* | ||
$toc.insertBefore("#article"); | $toc.insertBefore("#article"); | ||
Line 18: | Line 19: | ||
$toc.attr("data-sticky-on", "large"); | $toc.attr("data-sticky-on", "large"); | ||
$toc.addClass("sticky").foundation(); //Re-initialise foundation | $toc.addClass("sticky").foundation(); //Re-initialise foundation | ||
+ | */ | ||
}); | }); |
Latest revision as of 02:48, 20 October 2016
$(document).ready(function(){ $(document).foundation();
//Dirty sticky wiki toc hack var $toc = $("#toc"); //Retrieve TOC and cache
//Reposition TOC in DOM $toc.detach(); /* $toc.insertBefore("#article");
//Create container
$toc.wrap("");//Add necessary attributes and class $toc.attr("data-sticky", ""); $toc.attr("data-anchor", "article"); $toc.attr("data-margin-top", "2"); $toc.attr("data-sticky-on", "large"); $toc.addClass("sticky").foundation(); //Re-initialise foundation */ });