To divide the long html file with the columns, I used css3 columns.
padding: 0px
height: 1024px
-webkit-column-gap: 0px
-webkit-column-width: 768px
And i wanted to get the position of the specified element, so i used the following javascript code.
function getPos(el) {
for( var lx=0, ly=0; el!=null; lx+=el.offsetLeft, ly+=el.offsetTop, el=el.offsetParent);
return {x:lx, y:ly};
}
I thought that the y value is in range of 0 to height:1024px, but that value exceeds 1024 and x value is in range of 0 to column-width:768.
How can i get the realative position from the first top left position which y is in 0 to 1024 and x is some value?
I'm sorry for my poor english.
Thanks.