<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Carbon Emitter &#187; jQuery</title>
	<atom:link href="http://blog.carbonfive.com/tag/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.carbonfive.com</link>
	<description>The blog of Carbon Five</description>
	<lastBuildDate>Mon, 23 Jan 2012 18:38:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Absolutize for jQuery</title>
		<link>http://blog.carbonfive.com/2008/09/11/absolutize-for-jquery/</link>
		<comments>http://blog.carbonfive.com/2008/09/11/absolutize-for-jquery/#comments</comments>
		<pubDate>Thu, 11 Sep 2008 22:34:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Everything Else]]></category>
		<category><![CDATA[JavaScript / AJAX]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://blog.carbonfive.com/?p=194</guid>
		<description><![CDATA[We&#8217;re using jQuery for one of our current projects. Today I found myself in an IE situation that could be solved by using the prototype librarie&#8217;s absolutize method. I couldn&#8217;t find any equivilent implementation that I liked in jQuery so &#8230; <a href="http://blog.carbonfive.com/2008/09/11/absolutize-for-jquery/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re using jQuery for one of our current projects. Today I found myself in an IE situation that could be solved by using the prototype librarie&#8217;s <a href="http://www.prototypejs.org/api/element/absolutize">absolutize method</a>. I couldn&#8217;t find any equivilent implementation that I liked in jQuery so I went ahead and ported absolutize from prototype to jquery.</p>
<p><a href="http://plugins.jquery.com/project/absolutize_prototype_port">Download Here</a></p>
<p>It can be used in the standard jQuery way, like so:</p>
<pre class="brush: jscript; light: true; title: ; wrap-lines: false; notranslate">$('some-selector').absolutize()</pre>
<p>Here&#8217;s the code:</p>
<pre class="brush: jscript; light: true; title: ; wrap-lines: false; notranslate">jQuery.fn.absolutize = function()
{
  return this.each(function()
  {
    var element = jQuery(this);
    if (element.css('position') == 'absolute')
    {
      return element;
    }

    var offsets = element.offset();
    var top = offsets.top;
    var left = offsets.left;
    var width = element[0].clientWidth;
    var height = element[0].clientHeight;

    element._originalLeft = left - parseFloat(element.css(&quot;left&quot;) || 0);
    element._originalTop = top - parseFloat(element.css(&quot;top&quot;) || 0);
    element._originalWidth = element.css(&quot;width&quot;);
    element._originalHeight = element.css(&quot;height&quot;);

    element.css(&quot;position&quot;, &quot;absolute&quot;);
    element.css(&quot;top&quot;, top + 'px');
    element.css(&quot;left&quot;, left + 'px');
    element.css(&quot;width&quot;, width + 'px');
    element.css(&quot;height&quot;, height + 'px');
    return element;

  });
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.carbonfive.com/2008/09/11/absolutize-for-jquery/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

