1
0
mirror of https://github.com/gsi-upm/sitc synced 2024-11-18 04:22:28 +00:00
sitc/lod/tutorial/js/header_links.js

14 lines
384 B
JavaScript
Raw Normal View History

2021-02-18 17:10:59 +00:00
// 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));
}
});
});