mirror of https://github.com/gsi-upm/sitc
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
384 B
JavaScript
14 lines
384 B
JavaScript
3 years ago
|
// 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));
|
||
|
}
|
||
|
});
|
||
|
});
|