le_francais/johann_footnotes.js
2023-01-21 22:23:12 +01:00

21 lines
625 B
JavaScript

$(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();
});
});
});