Firefox?????????????parent????Bug
???????????? ???????[ 2014/11/7 14:54:25 ] ?????????????????? ??????
getXY : function(element){
var y = element.offsetTop;
var x = element.offsetLeft;
while(element = element.offsetParent){
y += element.offsetTop;
x += element.offsetLeft;
}
return (new Array(x??y));
}
????ò???????????????????????o??????????????????(??????????log?????????)
getXY : function(element){
var y = element.offsetTop;
var x = element.offsetLeft;
var i=0;
while(element = element.offsetParent){
y += element.offsetTop;
x += element.offsetLeft;
i++;
}
//firefox debug
console.log(i);
console.log(y);
console.log(x);
return (new Array(x??y));
}
??????ie9???4 120 100??????
????????0 0 0????????????????д???????
????????????????????????????????????????д??????????????????????????
????while(element = element.offsetParent)????????????false??..?????????
????????????javascript????????????????.
?????????element.offsetParent????????null
???????????????bug??????????п???????д???????????????洫??element??????
?????????????????????????????????????????????ж????????element = element.offsetParent????????????.
??????????β????or?????offsetParent???????????(????????????????????????????????????body?????????null???????)????????Σ???css???????ò?????????????
getXY : function(element){
var y = element.offsetTop;
var x = element.offsetLeft;
var i=0;
if(!element.offsetParent)
console.log("null");
console.log(element.id);
while(element = element.offsetParent){
y += element.offsetTop;
x += element.offsetLeft;
i++;
}
//firefox debug
console.log(i);
console.log(y);
console.log(x);
return (new Array(x??y));
}
?????????????????id????ie????????????????в???и?id??????????????д????????ie??????????????????????ò?????parent??????????ú?ie???(???????ie????)
??????????????????????????д????xx_xx?????????????????????????????????????????????????????
?????? ???????????input????????????????3????????????????????????.??firefox?£?????????ι????????body??? (?μ?)??????????(??????????????????????????????bug)?????????????????????????BUG??clear(??getXY???ù??н? ????????????????????)
????offsetParent??????????level0?????????????
??????jq?е?>???????????????????????bug???????jq?????????BUG?????????????????
?????????????Щcss???????????????select??fous????????????????input????????ie6?2??????xinput???????????鷳??
????????????о???????????????????????div??????????????Ч?????????????????????????λ?????ü??????????£????к???????????е????????????
?????????????????????getYear()??getFullYear()??????????? getYear()????????????????????????Const????????????????????????????date()????????????????date()??????????????????????????????????????Const????????????????????ú?????
?????????????????????bug??????????????????????????????..???????????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11