* Function: ng_findMousePosX * Determines horizontal element offset to absolute mouse position. * * Syntax: * int *ng_findMousePosX* (object obj) * * Parameters: * obj - element object * * Returns: * Offset to be substracted from the absolute mouse position.
(obj)
| 1452 | * Offset to be substracted from the absolute mouse position. |
| 1453 | */ |
| 1454 | function ng_findMousePosX(obj) |
| 1455 | { |
| 1456 | var curleft = 0; |
| 1457 | if(obj.offsetParent) |
| 1458 | { |
| 1459 | while(obj.offsetParent) |
| 1460 | { |
| 1461 | curleft += obj.offsetLeft; |
| 1462 | curleft -= obj.scrollLeft; |
| 1463 | if(ngFireFox) |
| 1464 | { |
| 1465 | if((ng_GetCurrentStyle(obj,'overflow')!=='auto')||((ngFireFox1x)||(ngFireFox2x))) |
| 1466 | curleft+=2*ng_GetCurrentStylePx(obj,'border-left-width'); |
| 1467 | else |
| 1468 | curleft+=ng_GetCurrentStylePx(obj,'border-left-width'); |
| 1469 | } |
| 1470 | else |
| 1471 | { |
| 1472 | if((!ngOpera)) //Opera 10.5 still doesn't need this !!! |
| 1473 | curleft +=ng_GetCurrentStylePx(obj,'border-left-width'); |
| 1474 | } |
| 1475 | |
| 1476 | obj = obj.offsetParent; |
| 1477 | } |
| 1478 | } |
| 1479 | else if(obj.x) curleft += obj.x; |
| 1480 | curleft -= ng_DocumentScrollX(); |
| 1481 | return curleft; |
| 1482 | } |
| 1483 | |
| 1484 | /** |
| 1485 | * Function: ng_findMousePosY |
no test coverage detected