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
|
var mALarg = 0, maHaut = 0;
if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
{
//IE 6 et standards
maLarg = document.documentElement.clientWidth;
maHaut = document.documentElement.clientHeight;
}
else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
{
//IE 4 et compatibles
maLarg = document.body.clientWidth;
maHaut = document.body.clientHeight;
}
else if( typeof( window.innerWidth ) == 'number' )
{
//Pas-IE
maLarg = window.innerWidth;
maHaut = window.innerHeight;
}
var scrollY = document.documentElement.scrollTop;
var scrollX = document.documentElement.scrollLeft;
var largeurContenu = 500;
var fond = document.createElement('div');
fond.style.zIndex = '9999';
fond.style.position = 'absolute';
fond.style.width = scrollX + maLarg + 'px';
fond.style.height = scrollY + maHaut + 'px';
fond.id = 'infoslegales';
fond.style.background = 'url("style/fd_divInfosLegales.png")';
var contenu = document.createElement('div');
contenu.style.width = largeurContenu +'px';
contenu.style.marginLeft = ((maLarg - largeurContenu) /2) +'px';
// reste du code |
Partager