mirror of
https://github.com/gsi-upm/sitc
synced 2024-11-05 23:41:42 +00:00
14 lines
384 B
JavaScript
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));
|
|
}
|
|
});
|
|
});
|