I have two checkbox items which are called Chk_1
and Chk_2
( both as name
and id
) :
<td><input type="checkbox" name="Chk_1" id="Chk_1" style="position:absolute;" ></></td>
<input type="checkbox" name="Chk_2" id="Chk_2" style="position:absolute;" ></>
where Chk_1
is defined in a table
's tabledata
(<td>
) as seen above, whereas Chk_2
is located independent from a table.
I'm trying to position the item Chk_2
with respect to Chk_1
's position by a Javascript function as below :
function FnCentikYerlestir() {
var Chk1 = document.getElementById("Chk_1").getBoundingClientRect();
var Chk2 = document.getElementById("Chk_2");
Chk2.style.left=Chk1.left+500+"px";
Chk2.style.top =Chk1.top+200+"px";
}
[ where Chk1.left
returns 1124
, and Chk1.top
returns 440
, if it's worth to mention. ]
My page calls this function
by onload
method as :
<body bgcolor="#FFF8DC" onload="FnCentikYerlestir();">
There occurs no problem here, but after relocation, the item Chk_2
becomes disabled, and it's impossible to check it.
Could you tell me What the issue could be, and how I can fix that ..?
Aucun commentaire:
Enregistrer un commentaire