Image background et redimensionnement

evilfrog83 Messages postés 3 Date d'inscription mercredi 17 avril 2002 Statut Membre Dernière intervention 14 mai 2002 - 14 mai 2002 à 09:25
nicenails Messages postés 2 Date d'inscription lundi 28 juin 2004 Statut Membre Dernière intervention 21 novembre 2004 - 21 nov. 2004 à 12:51
Comment puis-je faire pour qu'une image positionnée en temps que fond d'un tableau puisse s'agrandir et se rétrécir en fonction de la taille de celui-ci. En gros, j'aimerais savoir comment puis-je faire pour qu'une image de fond apparaisse tjrs en entier.

merci

1 réponse

nicenails Messages postés 2 Date d'inscription lundi 28 juin 2004 Statut Membre Dernière intervention 21 novembre 2004
21 nov. 2004 à 12:51
a insérer directement ds le body

<SCRIPT language="JavaScript" title="image resize">
/*
ETIRER LE FONT ECRAN A LA TAILLE DE L'ECRAN
*/
function makeIm(){
NS4=(document.layers);
IE4=(document.all);
scaleWidth = true;
scaleHeight = true;
imSRC = "xxxxxxxxxxx.jpg"; // MODIFIEZ ICI VOTRE IMAGE
if (NS4){
origWidth = innerWidth;
origHeight = innerHeight}
function reDo(){
if (innerWidth != origWidth || innerHeight != origHeight)
location.reload()}
if (NS4) onresize = reDo;
if (IE4) onresize = reDoIE;
function reDoIE(){
imBG.width = document.body.clientWidth;
imBG.height = document.body.clientHeight}
winWid = (NS4) ? innerWidth : document.body.clientWidth;
winHgt = (NS4) ? innerHeight : document.body.clientHeight;
imStr = "
"
+ "
";
document.write(imStr)}
makeIm();
</SCRIPT>
0
Rejoignez-nous