1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
function fenetre(titre,url,left,top) {
var larg = window.innerWidth?window.innerWidth:document.body.offsetWidth;
//var larg = (document.body.offsetWidth);
larg = larg /2;
larg = larg - 405;
larg = parseInt(larg,10)+ parseInt(left,10);
var haut = parseInt(top,10) + 80+20;
var monCalque=document.createElement('div');
var test =document.getElementById("carteL");
monCalque.setAttribute("id","maclasse");
monCalque.setAttribute("idName","maclasse");
monCalque.style.left = larg+'px';
monCalque.style.top = haut+'px';
monCalque.style.position = 'absolute';
if (navigator.appName=="Microsoft Internet Explorer") {
var strChUserAgent = navigator.userAgent;
var intSplitStart = strChUserAgent.indexOf("(",0);
var intSplitEnd = strChUserAgent.indexOf(")",0);
var strChStart = strChUserAgent.substring(0,intSplitStart);
var strChMid = strChUserAgent.substring(intSplitStart, intSplitEnd);
var strChEnd = strChUserAgent.substring(strChEnd);
if ((strChMid.indexOf("MSIE 7") != -1) || (strChMid.indexOf("MSIE 6") != -1)) {
monCalque.style.border = '4px solid #F00';
monCalque.style.height = "0.1px";
} else {
monCalque.style.border = '4px solid #F00';
}
} else {
monCalque.style.border = '4px solid #F00';
}
test.appendChild(monCalque);
}
function close_fen() {
document.getElementById("carteL").removeChild(document.getElementById("maclasse"));
} |
Partager