le_francais/johann_footnotes.js

21 lines
625 B
JavaScript
Raw Normal View History

2023-01-21 21:23:12 +00:00
$(document).ready(() => {
$("a[id^='footnote_source_']").each((idx, elm) => {
var id = elm.id.slice(16);
var footnote = $("#footnote_" + id).parent().text();
var popup;
$(elm).mouseover(() => {
popup = $("<div></div>").text(footnote).css({
position: "absolute",
top: $(elm).offset().top,
left: $(elm).offset().left + $(elm).width(),
background: "white",
border: "1px solid black",
padding: "5px",
"z-index": 1000
}).appendTo("body");
}).mouseout(() => {
$(popup).remove();
});
});
});