getElementById().style.Width
Je voudrais placer un input a l'aide d'un fonction Javascript mais mon soucis est que mon composant ne se place pas malgré les propriétes de position,
Voici ma fonction Javascript :
Code:
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
|
function ShowDiv(PosWidth,PosLeft,PosHeight,PosTop,CouleurFluo,Text,Police,Taille,Couleur){
if(document.getElementById('NewText').style.display == "block"){
document.getElementById('NewText').style.display = "none";
}else{
document.getElementById('NewText').style.display = "block";
}
document.getElementById('NewText').style.position = "absolute";
document.getElementById('NewText').style.Width = PosWidth+"px";
document.getElementById('NewText').style.Left = PosLeft+"px";
document.getElementById('NewText').style.Height = PosHeight+"px";
document.getElementById('NewText').style.Top = PosTop+"px";
if(CouleurFluo!=""){
document.getElementById('NewText').style.backgroundColor = '#'+CouleurFluo+'';
document.getElementById('NewText').style.filter = "alpha(opacity=50);";
document.getElementById('NewText').value = "";
document.getElementById('NewText').style.fontFamily = "";
document.getElementById('NewText').style.fontSize = "";
document.getElementById('NewText').style.color = "";
}else{
document.getElementById('NewText').style.backgroundColor = "";
document.getElementById('NewText').style.filter = "";
document.getElementById('NewText').value = Text;
document.getElementById('NewText').style.fontFamily = Police;
document.getElementById('NewText').style.fontSize = Taille;
document.getElementById('NewText').style.color = '#'+Couleur+'';
}
} |
Voici mon appel de fonction :
Code:
1 2 3
|
<td OnClick="ShowDiv('492','154','72','52','FFFF66','','','','');"> |
Je vois bien mon input mais il se met toujours tout en haut à gauche de ma page ??