<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: The Shadower - Realistic Drop Shadows in Javascript</title>
	<atom:link href="http://www.erik-rasmussen.com/blog/2006/12/04/the-shadower-realistic-drop-shadows-in-javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.erik-rasmussen.com/blog/2006/12/04/the-shadower-realistic-drop-shadows-in-javascript/</link>
	<description>Thoughts and photos from an American living in Spain.</description>
	<pubDate>Fri, 29 Aug 2008 22:44:18 +0000</pubDate>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>By: Francesco Mazzi</title>
		<link>http://www.erik-rasmussen.com/blog/2006/12/04/the-shadower-realistic-drop-shadows-in-javascript/#comment-2869</link>
		<dc:creator>Francesco Mazzi</dc:creator>
		<pubDate>Mon, 18 Aug 2008 13:26:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.erik-rasmussen.com/blog/2006/12/04/the-shadower-realistic-drop-shadows-in-javascript/#comment-2869</guid>
		<description>Hi, excellent work!
I needed a uniform shadowin all directions, so I added another function to Shadower:

&lt;code&gt;uniform_shadow: function(element)
&#160;&#160;{
&#160;&#160;&#160;&#160;element = $(element);
&#160;&#160;&#160;&#160;var options = Object.extend(
&#160;&#160;&#160;&#160;{
&#160;&#160;&#160;&#160;&#160;&#160;distance: 8,
&#160;&#160;&#160;&#160;&#160;&#160;opacity: 0.7,
&#160;&#160;&#160;&#160;&#160;&#160;nestedShadows: 4,
&#160;&#160;&#160;&#160;&#160;&#160;color: '#000000'
&#160;&#160;&#160;&#160;}, arguments[1] &#124;&#124; {});
&#160;&#160;&#160;&#160;var positionStyle = Element.getStyle(element, 'position');
&#160;&#160;&#160;&#160;var parent = element.parentNode;
&#160;&#160;&#160;&#160;if (!element.shadowZIndex)
&#160;&#160;&#160;&#160;{
&#160;&#160;&#160;&#160;&#160;&#160;if (positionStyle != 'absolute' &#38;&#38; positionStyle != 'fixed')
&#160;&#160;&#160;&#160;&#160;&#160;{
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;var placeHolder = this.idSafeClone(element);
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;placeHolder.id = null;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;parent.insertBefore(placeHolder, element);
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Position.absolutize(element);
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Position.clone(placeHolder, element);
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;element.style.margin = '0';
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;placeHolder.style.visibility = 'hidden';
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;positionStyle = 'absolute';
&#160;&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;&#160;&#160;element.shadowZIndex = new Number(Element.getStyle(element, 'zIndex') ? Element.getStyle(element, 'zIndex') : 1);
&#160;&#160;&#160;&#160;&#160;&#160;element.style.zIndex = element.shadowZIndex + options.nestedShadows;
&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;if (arguments[2])  // force recreate
&#160;&#160;&#160;&#160;&#160;&#160;this.deshadow(element);
&#160;&#160;&#160;&#160;// create shadows
&#160;&#160;&#160;&#160;if (!element.shadows)
&#160;&#160;&#160;&#160;{
&#160;&#160;&#160;&#160;&#160;&#160;element.shadows = new Array(options.nestedShadows);
&#160;&#160;&#160;&#160;&#160;&#160;for (var i = 0; i &#60; options.nestedShadows; i++)
&#160;&#160;&#160;&#160;&#160;&#160;{
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;var shadow = document.createElement('div');
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Element.hide(shadow);
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;shadow.appendChild(document.createTextNode(' '));
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;if (parent)
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;parent.appendChild(shadow);
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;shadow.style.position = positionStyle;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;shadow.style.backgroundColor = options.color;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Element.setOpacity(shadow, options.opacity / options.nestedShadows);
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;shadow.style.zIndex = element.shadowZIndex + i;
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;element.shadows[i] = shadow;
&#160;&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;var legendHeight = this.getLegendHeight(element);
&#160;&#160;&#160;&#160;// position shadows
&#160;&#160;&#160;&#160;Position.prepare();
&#160;&#160;&#160;&#160;var offsets = Position.positionedOffset(element);
&#160;&#160;&#160;&#160;var topOffset = -options.distance;
&#160;&#160;&#160;&#160;var leftOffset = -options.distance;
&#160;&#160;&#160;&#160;element.shadows.each(function(shadow, i)
&#160;&#160;&#160;&#160;{
&#160;&#160;&#160;&#160;&#160;&#160;shadow.style.top = Math.ceil(offsets[1] + topOffset + i + (legendHeight / 2)) + 'px';
&#160;&#160;&#160;&#160;&#160;&#160;shadow.style.left = (offsets[0] + leftOffset + i) + 'px';
&#160;&#160;&#160;&#160;&#160;&#160;shadow.style.width = (element.offsetWidth - (2 * i)) + 2 * options.distance + 'px';
&#160;&#160;&#160;&#160;&#160;&#160;shadow.style.height = (element.offsetHeight - (2 * i) - (legendHeight / 2)) + 2* options.distance + 'px';
&#160;&#160;&#160;&#160;&#160;&#160;Element.show(shadow);
&#160;&#160;&#160;&#160;});
&#160;&#160;},&lt;/code&gt;
I hope it will be useful...let me know!
Bye</description>
		<content:encoded><![CDATA[<p>Hi, excellent work!<br />
I needed a uniform shadowin all directions, so I added another function to Shadower:</p>
<p><code>uniform_shadow: function(element)<br />
&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;element = $(element);<br />
&nbsp;&nbsp;&nbsp;&nbsp;var options = Object.extend(<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;distance: 8,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;opacity: 0.7,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nestedShadows: 4,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;color: '#000000'<br />
&nbsp;&nbsp;&nbsp;&nbsp;}, arguments[1] || {});<br />
&nbsp;&nbsp;&nbsp;&nbsp;var positionStyle = Element.getStyle(element, &#8216;position&#8217;);<br />
&nbsp;&nbsp;&nbsp;&nbsp;var parent = element.parentNode;<br />
&nbsp;&nbsp;&nbsp;&nbsp;if (!element.shadowZIndex)<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (positionStyle != &#8216;absolute&#8217; &amp;&amp; positionStyle != &#8216;fixed&#8217;)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var placeHolder = this.idSafeClone(element);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;placeHolder.id = null;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent.insertBefore(placeHolder, element);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Position.absolutize(element);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Position.clone(placeHolder, element);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;element.style.margin = &#8216;0&#8242;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;placeHolder.style.visibility = &#8216;hidden&#8217;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;positionStyle = &#8216;absolute&#8217;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;element.shadowZIndex = new Number(Element.getStyle(element, &#8216;zIndex&#8217;) ? Element.getStyle(element, &#8216;zIndex&#8217;) : 1);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;element.style.zIndex = element.shadowZIndex + options.nestedShadows;<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;if (arguments[2])  // force recreate<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this.deshadow(element);<br />
&nbsp;&nbsp;&nbsp;&nbsp;// create shadows<br />
&nbsp;&nbsp;&nbsp;&nbsp;if (!element.shadows)<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;element.shadows = new Array(options.nestedShadows);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (var i = 0; i &lt; options.nestedShadows; i++)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var shadow = document.createElement(&#8217;div&#8217;);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Element.hide(shadow);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;shadow.appendChild(document.createTextNode(&#8217; &#8216;));<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (parent)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parent.appendChild(shadow);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;shadow.style.position = positionStyle;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;shadow.style.backgroundColor = options.color;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Element.setOpacity(shadow, options.opacity / options.nestedShadows);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;shadow.style.zIndex = element.shadowZIndex + i;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;element.shadows[i] = shadow;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;var legendHeight = this.getLegendHeight(element);<br />
&nbsp;&nbsp;&nbsp;&nbsp;// position shadows<br />
&nbsp;&nbsp;&nbsp;&nbsp;Position.prepare();<br />
&nbsp;&nbsp;&nbsp;&nbsp;var offsets = Position.positionedOffset(element);<br />
&nbsp;&nbsp;&nbsp;&nbsp;var topOffset = -options.distance;<br />
&nbsp;&nbsp;&nbsp;&nbsp;var leftOffset = -options.distance;<br />
&nbsp;&nbsp;&nbsp;&nbsp;element.shadows.each(function(shadow, i)<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;shadow.style.top = Math.ceil(offsets[1] + topOffset + i + (legendHeight / 2)) + &#8216;px&#8217;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;shadow.style.left = (offsets[0] + leftOffset + i) + &#8216;px&#8217;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;shadow.style.width = (element.offsetWidth - (2 * i)) + 2 * options.distance + &#8216;px&#8217;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;shadow.style.height = (element.offsetHeight - (2 * i) - (legendHeight / 2)) + 2* options.distance + &#8216;px&#8217;;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Element.show(shadow);<br />
&nbsp;&nbsp;&nbsp;&nbsp;});<br />
&nbsp;&nbsp;},</code><br />
I hope it will be useful&#8230;let me know!<br />
Bye</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ravi</title>
		<link>http://www.erik-rasmussen.com/blog/2006/12/04/the-shadower-realistic-drop-shadows-in-javascript/#comment-2516</link>
		<dc:creator>ravi</dc:creator>
		<pubDate>Sat, 24 May 2008 06:34:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.erik-rasmussen.com/blog/2006/12/04/the-shadower-realistic-drop-shadows-in-javascript/#comment-2516</guid>
		<description>iam geeting error on the IE7 style is not an object.and also images is coming 2 times</description>
		<content:encoded><![CDATA[<p>iam geeting error on the IE7 style is not an object.and also images is coming 2 times</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik R.</title>
		<link>http://www.erik-rasmussen.com/blog/2006/12/04/the-shadower-realistic-drop-shadows-in-javascript/#comment-1314</link>
		<dc:creator>Erik R.</dc:creator>
		<pubDate>Thu, 15 Nov 2007 15:12:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.erik-rasmussen.com/blog/2006/12/04/the-shadower-realistic-drop-shadows-in-javascript/#comment-1314</guid>
		<description>Excellent points, Guillaume!  I've taken the liberty of formatting the code in your comment.  I love how you initialize all your variables to null at the top of the function.  Program in C much?  :-)

I was already aware of the style bug and had fixed it in my version that I'm using in production, but I had forgotten to update the one on this post.

You're absolutely right about the id collision bug.  I might do the idSafeClone a little differently, more in the style of prototype.js.

&lt;code&gt;idSafeClone: function(node)
{
&#160;&#160;var clone = node.cloneNode(false);
&#160;&#160;if (clone.hasAttribute &#38;&#38; clone.hasAttribute('id'))
&#160;&#160;&#160;&#160;clone.removeAttribute('id');
&#160;&#160;var clonedChildren =
&#160;&#160;&#160;&#160;$A(node.childNodes).collect(this.idSafeClone.bind(this));
&#160;&#160;clonedChildren.each(function(child) {
&#160;&#160;&#160;&#160;clone.appendChild(child);
&#160;&#160;});
&#160;&#160;return clone;
}&lt;/code&gt;
It was tempting to chain the collect() and each() calls together, but I went with the clarity of assigning a variable.  And it can be even more elegant if you don't mind traversing the tree twice, because then you can write only a function to strip ids and say stripIds(node.cloneNode(true)) and be done.

Again, thank you for your insight into these problems.  I'll fix the file that's hosted here with your ideas.  I've also added some trickery to allow shadowing of fieldsets, since the legend screws with the height measurements.</description>
		<content:encoded><![CDATA[<p>Excellent points, Guillaume!  I&#8217;ve taken the liberty of formatting the code in your comment.  I love how you initialize all your variables to null at the top of the function.  Program in C much?  <img src='http://www.erik-rasmussen.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>I was already aware of the style bug and had fixed it in my version that I&#8217;m using in production, but I had forgotten to update the one on this post.</p>
<p>You&#8217;re absolutely right about the id collision bug.  I might do the idSafeClone a little differently, more in the style of prototype.js.</p>
<p><code>idSafeClone: function(node)<br />
{<br />
&nbsp;&nbsp;var clone = node.cloneNode(false);<br />
&nbsp;&nbsp;if (clone.hasAttribute &amp;&amp; clone.hasAttribute('id'))<br />
&nbsp;&nbsp;&nbsp;&nbsp;clone.removeAttribute('id');<br />
&nbsp;&nbsp;var clonedChildren =<br />
&nbsp;&nbsp;&nbsp;&nbsp;$A(node.childNodes).collect(this.idSafeClone.bind(this));<br />
&nbsp;&nbsp;clonedChildren.each(function(child) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;clone.appendChild(child);<br />
&nbsp;&nbsp;});<br />
&nbsp;&nbsp;return clone;<br />
}</code><br />
It was tempting to chain the collect() and each() calls together, but I went with the clarity of assigning a variable.  And it can be even more elegant if you don&#8217;t mind traversing the tree twice, because then you can write only a function to strip ids and say stripIds(node.cloneNode(true)) and be done.</p>
<p>Again, thank you for your insight into these problems.  I&#8217;ll fix the file that&#8217;s hosted here with your ideas.  I&#8217;ve also added some trickery to allow shadowing of fieldsets, since the legend screws with the height measurements.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Guillaume</title>
		<link>http://www.erik-rasmussen.com/blog/2006/12/04/the-shadower-realistic-drop-shadows-in-javascript/#comment-1312</link>
		<dc:creator>Guillaume</dc:creator>
		<pubDate>Thu, 15 Nov 2007 02:09:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.erik-rasmussen.com/blog/2006/12/04/the-shadower-realistic-drop-shadows-in-javascript/#comment-1312</guid>
		<description>Nice idea, Erik!

However, I noticed a couple issues with the code.

The script is currently making a clone of the element in case the position style applied to it is not an 'absolute' one.
First, the style check doesn't seems to work since even with absolutely positioned element a node cloning was happening (checked on FF/XP, FF/Mac, not too sure of other browsers).
I would consider this a medium level issue since it doesn't have side effects.

Second, and this one can induce quite nasty bugs.
When creating the place holder subtree, you definately take care to remove the id attribute of the top node but the subnodes ids do still exist, which causes access by getElementById() to fail since they access the hidden place holder copy elements.

I tinkered a fix myself but you may be interested in double checking it for yourself :

&lt;code&gt;var placeHolder = element.cloneNode(true);
placeHolder.id = null;&lt;/code&gt;
=&#62;
&lt;code&gt;var placeHolder = Shadower.idSafeClone(element);&lt;/code&gt;
and the idSafeClone method would be the following

&lt;code&gt;idSafeClone: function(node) 
{
&#160;&#160;var id = null;
&#160;&#160;var clone = null;
&#160;&#160;var children = null;
&#160;&#160;if (node.nodeType == Node.ELEMENT_NODE) {
&#160;&#160;&#160;&#160;id = node.getAttribute('id');
&#160;&#160;&#160;&#160;if (id) {
&#160;&#160;&#160;&#160;&#160;&#160;node.removeAttribute('id');
&#160;&#160;&#160;&#160;}
&#160;&#160;}
&#160;&#160;clone = node.cloneNode(false);
&#160;&#160;if (node.nodeType == Node.ELEMENT_NODE) {
&#160;&#160;&#160;&#160;if (id) {
&#160;&#160;&#160;&#160;&#160;&#160;node.setAttribute('id', id);
&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;if (node.hasChildNodes()) {
&#160;&#160;&#160;&#160;&#160;&#160;children = node.childNodes;
&#160;&#160;&#160;&#160;&#160;&#160;for (i = 0; i &#60; children.length; i++) {
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;childClone = Shadower.idSafeClone(children[i]);
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;clone.appendChild(childClone);
&#160;&#160;&#160;&#160;&#160;&#160;}
&#160;&#160;&#160;&#160;}
&#160;&#160;}
&#160;&#160;return clone;
}&lt;/code&gt;

Checked working on XP(IE6,IE7,FF), Mac(Safari, FF)

There are probably ways to optimize it but I didn't have the time for this.</description>
		<content:encoded><![CDATA[<p>Nice idea, Erik!</p>
<p>However, I noticed a couple issues with the code.</p>
<p>The script is currently making a clone of the element in case the position style applied to it is not an &#8216;absolute&#8217; one.<br />
First, the style check doesn&#8217;t seems to work since even with absolutely positioned element a node cloning was happening (checked on FF/XP, FF/Mac, not too sure of other browsers).<br />
I would consider this a medium level issue since it doesn&#8217;t have side effects.</p>
<p>Second, and this one can induce quite nasty bugs.<br />
When creating the place holder subtree, you definately take care to remove the id attribute of the top node but the subnodes ids do still exist, which causes access by getElementById() to fail since they access the hidden place holder copy elements.</p>
<p>I tinkered a fix myself but you may be interested in double checking it for yourself :</p>
<p><code>var placeHolder = element.cloneNode(true);<br />
placeHolder.id = null;</code><br />
=&gt;<br />
<code>var placeHolder = Shadower.idSafeClone(element);</code><br />
and the idSafeClone method would be the following</p>
<p><code>idSafeClone: function(node)<br />
{<br />
&nbsp;&nbsp;var id = null;<br />
&nbsp;&nbsp;var clone = null;<br />
&nbsp;&nbsp;var children = null;<br />
&nbsp;&nbsp;if (node.nodeType == Node.ELEMENT_NODE) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;id = node.getAttribute('id');<br />
&nbsp;&nbsp;&nbsp;&nbsp;if (id) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;node.removeAttribute('id');<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;}<br />
&nbsp;&nbsp;clone = node.cloneNode(false);<br />
&nbsp;&nbsp;if (node.nodeType == Node.ELEMENT_NODE) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;if (id) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;node.setAttribute('id', id);<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;if (node.hasChildNodes()) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;children = node.childNodes;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for (i = 0; i &lt; children.length; i++) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;childClone = Shadower.idSafeClone(children[i]);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;clone.appendChild(childClone);<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;}<br />
&nbsp;&nbsp;return clone;<br />
}</code></p>
<p>Checked working on XP(IE6,IE7,FF), Mac(Safari, FF)</p>
<p>There are probably ways to optimize it but I didn&#8217;t have the time for this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brett</title>
		<link>http://www.erik-rasmussen.com/blog/2006/12/04/the-shadower-realistic-drop-shadows-in-javascript/#comment-1232</link>
		<dc:creator>Brett</dc:creator>
		<pubDate>Fri, 19 Oct 2007 12:53:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.erik-rasmussen.com/blog/2006/12/04/the-shadower-realistic-drop-shadows-in-javascript/#comment-1232</guid>
		<description>What is a CSS class?  Isn't Shadower.shadow a class? Or what about 'testExample' (or if it isn't a class then what is it)?

I don't understand from your example what to put in my stylesheet and what to call it.

If I wanted all right aligned images (in Wordpress) to have shadows, would I use alignright as the class?  What style elements would I add to that class? Would I still need the Shadower.shadow class?

How would I call it in the body tag?

I would like a plugin (like the lightbox plugins) that implements this with a rel tag!  Better yet a plugin that automatically implements it on all images (or chosen image classes).

Otherwise, where in the folder structure (of wordpress) would I put the .js files?  Does prototype overwrite the prototype.js file already in the wordpress javascript directory?  

And how, then would I call the .js files in the header section (reletive paths or full path names)?</description>
		<content:encoded><![CDATA[<p>What is a CSS class?  Isn&#8217;t Shadower.shadow a class? Or what about &#8216;testExample&#8217; (or if it isn&#8217;t a class then what is it)?</p>
<p>I don&#8217;t understand from your example what to put in my stylesheet and what to call it.</p>
<p>If I wanted all right aligned images (in Wordpress) to have shadows, would I use alignright as the class?  What style elements would I add to that class? Would I still need the Shadower.shadow class?</p>
<p>How would I call it in the body tag?</p>
<p>I would like a plugin (like the lightbox plugins) that implements this with a rel tag!  Better yet a plugin that automatically implements it on all images (or chosen image classes).</p>
<p>Otherwise, where in the folder structure (of wordpress) would I put the .js files?  Does prototype overwrite the prototype.js file already in the wordpress javascript directory?  </p>
<p>And how, then would I call the .js files in the header section (reletive paths or full path names)?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Darksaint</title>
		<link>http://www.erik-rasmussen.com/blog/2006/12/04/the-shadower-realistic-drop-shadows-in-javascript/#comment-1161</link>
		<dc:creator>Darksaint</dc:creator>
		<pubDate>Thu, 27 Sep 2007 14:20:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.erik-rasmussen.com/blog/2006/12/04/the-shadower-realistic-drop-shadows-in-javascript/#comment-1161</guid>
		<description>Very nice little shadow script. Thanks</description>
		<content:encoded><![CDATA[<p>Very nice little shadow script. Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mikeyroy</title>
		<link>http://www.erik-rasmussen.com/blog/2006/12/04/the-shadower-realistic-drop-shadows-in-javascript/#comment-772</link>
		<dc:creator>mikeyroy</dc:creator>
		<pubDate>Wed, 30 May 2007 04:57:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.erik-rasmussen.com/blog/2006/12/04/the-shadower-realistic-drop-shadows-in-javascript/#comment-772</guid>
		<description>Awesome, awesome, awesome, awesome!

Only problem I've had is that in IE7 if a div I'm applying a shadow to contains javascript in there to display them (like google ads) the entire browser crashes. NBD though.</description>
		<content:encoded><![CDATA[<p>Awesome, awesome, awesome, awesome!</p>
<p>Only problem I&#8217;ve had is that in IE7 if a div I&#8217;m applying a shadow to contains javascript in there to display them (like google ads) the entire browser crashes. NBD though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: erik</title>
		<link>http://www.erik-rasmussen.com/blog/2006/12/04/the-shadower-realistic-drop-shadows-in-javascript/#comment-281</link>
		<dc:creator>erik</dc:creator>
		<pubDate>Thu, 14 Dec 2006 15:48:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.erik-rasmussen.com/blog/2006/12/04/the-shadower-realistic-drop-shadows-in-javascript/#comment-281</guid>
		<description>Yeah, I know it's not perfect in all cases.  I didn't think it was.  It uses absolute positioning to put the shadow divs behind the "shadowed" div.  I would have been surprised if you had told me that it &lt;em&gt;did&lt;/em&gt; worked with fixed-positioned divs.  Thanks for your testing and posting the results.</description>
		<content:encoded><![CDATA[<p>Yeah, I know it&#8217;s not perfect in all cases.  I didn&#8217;t think it was.  It uses absolute positioning to put the shadow divs behind the &#8220;shadowed&#8221; div.  I would have been surprised if you had told me that it <em>did</em> worked with fixed-positioned divs.  Thanks for your testing and posting the results.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mikeytown2</title>
		<link>http://www.erik-rasmussen.com/blog/2006/12/04/the-shadower-realistic-drop-shadows-in-javascript/#comment-280</link>
		<dc:creator>Mikeytown2</dc:creator>
		<pubDate>Thu, 14 Dec 2006 14:14:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.erik-rasmussen.com/blog/2006/12/04/the-shadower-realistic-drop-shadows-in-javascript/#comment-280</guid>
		<description>Hey i played around with this and a page i made uses position: fixed with great success. Your drop shadows fail when used in this kind of environment. Tested on XP SP2 IE6 &#38; FFox 2.0. &lt;a href="http://www-scf.usc.edu/~mcarper/TestShadow/media.html" rel="nofollow"&gt;Example&lt;/a&gt;. This page btw only uses 2 pictures for the background. Also unlike other pages that used a fixed div in FFox 2.0 when you put your mouse over the fixed div and use a scroll wheel it will scroll. &lt;a href="http://jessey.net/simon/articles/007.html" rel="nofollow"&gt;Example of problem&lt;/a&gt;. In short i used some minor css hacks to get IE &#38; Firefox to work how i want, just letting you know that your JS solution isn't perfect in all cases.</description>
		<content:encoded><![CDATA[<p>Hey i played around with this and a page i made uses position: fixed with great success. Your drop shadows fail when used in this kind of environment. Tested on XP SP2 IE6 &amp; FFox 2.0. <a href="http://www.erik-rasmussen.com/blog/go.php?http://www-scf.usc.edu/~mcarper/TestShadow/media.html" rel="nofollow" title="0 clicks" class="tooltipped" onmouseover="javascript:window.status='http://www-scf.usc.edu/~mcarper/TestShadow/media.html'; return false;" onmouseout="javascript:window.status=''; return false;" >Example</a>. This page btw only uses 2 pictures for the background. Also unlike other pages that used a fixed div in FFox 2.0 when you put your mouse over the fixed div and use a scroll wheel it will scroll. <a href="http://www.erik-rasmussen.com/blog/go.php?http://jessey.net/simon/articles/007.html" rel="nofollow" title="0 clicks" class="tooltipped" onmouseover="javascript:window.status='http://jessey.net/simon/articles/007.html'; return false;" onmouseout="javascript:window.status=''; return false;" >Example of problem</a>. In short i used some minor css hacks to get IE &amp; Firefox to work how i want, just letting you know that your JS solution isn&#8217;t perfect in all cases.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: erik</title>
		<link>http://www.erik-rasmussen.com/blog/2006/12/04/the-shadower-realistic-drop-shadows-in-javascript/#comment-279</link>
		<dc:creator>erik</dc:creator>
		<pubDate>Thu, 14 Dec 2006 13:55:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.erik-rasmussen.com/blog/2006/12/04/the-shadower-realistic-drop-shadows-in-javascript/#comment-279</guid>
		<description>Doh!  Okay, we'll split the blame then.  :-)

Usage code fixed.</description>
		<content:encoded><![CDATA[<p>Doh!  Okay, we&#8217;ll split the blame then.  <img src='http://www.erik-rasmussen.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Usage code fixed.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
