paste
that
.com
Share code, files, images, and links.
Twitter
Delicious
Reddit
Yahoo!
Google
StumbleUpon
Digg
Furl
New
getXY function
Post Follow-up
View Follow-ups (1)
Download
Login/Register
Recent Pastes
Post Follow-up
Text
File / Image
Link
Syntax:
(Automatic)
ActionScript
ActionScript 3
Bash
Brainfuck
C
C#
C++
CSS
Diff
Django/Jinja
ERB
Erlang
Genshi
Genshi Text
Gettext Catalog
HTML
INI
Java
JavaScript
Lua
Mako
Myghty
MySQL
Objective-C
Perl
PHP
Plaintext
Python
Python 3
Python console session
Python Traceback
Ruby
RHTML
Ruby irb session
Smarty
SQL
VB.net
XML
XSLT
Text:
/** * Returns the absolute X and Y positions of an object. * @param {HTMLObject} obj HTML Object. * @return {Object} Returns an accessor with .x and .y values. */ function getXY(obj) { var curleft = 0; var curtop = obj.offsetHeight + 5; var border; if (obj.offsetParent) { do { // XXX: If the element is position: relative we have to add borderWidth if (getStyle(obj, 'position') == 'relative') { if (border = _pub.getStyle(obj, 'border-top-width')) curtop += parseInt(border); if (border = _pub.getStyle(obj, 'border-left-width')) curleft += parseInt(border); } curleft += obj.offsetLeft; curtop += obj.offsetTop; } while (obj = obj.offsetParent) } else if (obj.x) { curleft += obj.x; curtop += obj.y; } return {'x': curleft, 'y': curtop}; } /** * Returns the specified computed style on an object. * @param {HTMLObject} obj HTML Object * @param {String} styleProp Property name. * @return {Mixed} Computed style on object. */ function getStyle(obj, styleProp) { if (obj.currentStyle) return obj.currentStyle[styleProp]; else if (window.getComputedStyle) return document.defaultView.getComputedStyle(obj,null).getPropertyValue(styleProp); }
Title:
Slug:
http://www.pastethat.com/
You may specify the URL slug to use for your paste. Minimum 5 characters.
Allow others to browse and search for this paste.
File:
Slug:
http://www.pastethat.com/
You may specify the URL slug to use for your paste. Minimum 5 characters.
Allow others to browse and search for this paste.
URL:
Slug:
http://www.pastethat.com/
You may specify the URL slug to use for your paste. Minimum 5 characters.
Allow others to browse and search for this paste.