| 13590 | |
| 13591 | //获取位置 |
| 13592 | function getContentClientRect(target){ |
| 13593 | var rect=target.getBoundingClientRect(); |
| 13594 | var compStyle=unsafeWindow.getComputedStyle(target); |
| 13595 | var pFloat=parseFloat; |
| 13596 | var top=rect.top + pFloat(compStyle.borderTopWidth); |
| 13597 | var right=rect.right - pFloat(compStyle.borderRightWidth); |
| 13598 | var bottom=rect.bottom - pFloat(compStyle.borderBottomWidth); |
| 13599 | var left=rect.left + pFloat(compStyle.borderLeftWidth); |
| 13600 | return { |
| 13601 | top:top, |
| 13602 | right:right, |
| 13603 | bottom:bottom, |
| 13604 | left:left, |
| 13605 | width:right-left, |
| 13606 | height:bottom-top, |
| 13607 | }; |
| 13608 | }; |
| 13609 | |
| 13610 | //获取窗口大小. |
| 13611 | function getWindowSize(){ |