1
0
mirror of https://github.com/gsi-upm/sitc synced 2024-11-22 06:22:29 +00:00
sitc/lod/tutorial/js/header_links.js
2021-02-18 18:10:59 +01:00

14 lines
384 B
JavaScript

// http://ben.balter.com/2014/03/13/pages-anchor-links/
$(function() {
return $("h2, h3, h4, h5, h6").each(function(i, el) {
var $el, icon, id;
$el = $(el);
id = $el.attr('id');
icon = '<i class="fa fa-link" style="font-size: 0.8em"></i>';
if (id) {
return $el.append($("<a />").addClass("header-link").attr("href", "#" + id).html(icon));
}
});
});