Commit ce6d2548 authored by Sylvain Coulange's avatar Sylvain Coulange
Browse files

ajout div aide

parent 96fcf2c1
......@@ -443,4 +443,38 @@ function toggleContentEditable() {
textZone.contentEditable = "true";
textZone.removeChild(gEndSave);
}
}
\ No newline at end of file
}
/////// POP-UP D'AIDE //////////
// SVG original width="1122.5601"
// SVG original height="793.59998"
function showPopDiv(el) {
var svgOriginWidth = 1122.5601;
var svgOriginHeigth = 793.59998;
var divWidth = document.getElementById('clavier').offsetWidth;
var divHeight = document.getElementById('clavier').offsetHeight;
var elx = el.getAttribute("x");
var ely = el.getAttribute("y");
var elWidth = el.getAttribute("width");
var elHeight = el.getAttribute("height");
var x = elx * divWidth / svgOriginWidth;
var y = ely * divWidth / svgOriginWidth;
var w = elWidth * divWidth / svgOriginWidth;
var h = elHeight * divHeight / svgOriginHeigth;
var popDiv = document.getElementById('popDiv');
popDiv.style.left = x - elWidth / 2 + 'px';
popDiv.style.top = y + h + 'px';
popDiv.style.width = divWidth / 4 +'px';
popDiv.src = "static/png/aideMot/" + "aideMot_" + id2class[el.getAttribute("id")] + ".png";
}
function hidePopDiv() {
document.getElementById('popDiv').src = "";
}
//////////////////////////////////////////////////////
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment