<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Creating an Accordian Widget Class with Prototype</title>
	<atom:link href="http://www.gregphoto.net/index.php/2006/08/30/creating-an-accordian-widget-class-with-prototype/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gregphoto.net/index.php/2006/08/30/creating-an-accordian-widget-class-with-prototype/</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Tue, 27 Dec 2011 06:48:25 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: CFDev</title>
		<link>http://www.gregphoto.net/index.php/2006/08/30/creating-an-accordian-widget-class-with-prototype/comment-page-1/#comment-125114</link>
		<dc:creator>CFDev</dc:creator>
		<pubDate>Fri, 22 Feb 2008 21:00:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.gregphoto.net/index.php/2006/08/30/creating-an-accordian-widget-class-with-prototype/#comment-125114</guid>
		<description>Awesome script, thank you. Is there any way to have an item open by default? I&#039;ve been playing and have this:

Event.observe(window,&#039;load&#039;,init,false);
function init() {
accordian = new Accordian(&#039;sectionContainer&#039;,&#039;h3&#039;);
var section = $(sTickets);
			this.currentSection = section.id;
			var contents = document.getElementsByClassName(&#039;contents&#039;,section);
			contents[0].show();
		}

But it requires me to click the open section before clicking another...</description>
		<content:encoded><![CDATA[<p>Awesome script, thank you. Is there any way to have an item open by default? I&#8217;ve been playing and have this:</p>
<p>Event.observe(window,&#8217;load&#8217;,init,false);<br />
function init() {<br />
accordian = new Accordian(&#8216;sectionContainer&#8217;,'h3&#8242;);<br />
var section = $(sTickets);<br />
			this.currentSection = section.id;<br />
			var contents = document.getElementsByClassName(&#8216;contents&#8217;,section);<br />
			contents[0].show();<br />
		}</p>
<p>But it requires me to click the open section before clicking another&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: C. James Callaway</title>
		<link>http://www.gregphoto.net/index.php/2006/08/30/creating-an-accordian-widget-class-with-prototype/comment-page-1/#comment-100850</link>
		<dc:creator>C. James Callaway</dc:creator>
		<pubDate>Wed, 28 Nov 2007 16:59:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.gregphoto.net/index.php/2006/08/30/creating-an-accordian-widget-class-with-prototype/#comment-100850</guid>
		<description>Thanks for the great tutorial.  With this information I was able to write my own definition list based accordion control (only 2.1kb).  

Keep up the good work, thanks again.</description>
		<content:encoded><![CDATA[<p>Thanks for the great tutorial.  With this information I was able to write my own definition list based accordion control (only 2.1kb).  </p>
<p>Keep up the good work, thanks again.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JP</title>
		<link>http://www.gregphoto.net/index.php/2006/08/30/creating-an-accordian-widget-class-with-prototype/comment-page-1/#comment-82883</link>
		<dc:creator>JP</dc:creator>
		<pubDate>Wed, 08 Aug 2007 15:41:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.gregphoto.net/index.php/2006/08/30/creating-an-accordian-widget-class-with-prototype/#comment-82883</guid>
		<description>Does not work:

Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or &#039;}&#039; in /home/bookm6/public_html/tree3/db.php on line 5</description>
		<content:encoded><![CDATA[<p>Does not work:</p>
<p>Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or &#8216;}&#8217; in /home/bookm6/public_html/tree3/db.php on line 5</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CustomPartner.com &#187; Creating an Accordian Widget Class with Prototype</title>
		<link>http://www.gregphoto.net/index.php/2006/08/30/creating-an-accordian-widget-class-with-prototype/comment-page-1/#comment-80021</link>
		<dc:creator>CustomPartner.com &#187; Creating an Accordian Widget Class with Prototype</dc:creator>
		<pubDate>Thu, 19 Jul 2007 16:57:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.gregphoto.net/index.php/2006/08/30/creating-an-accordian-widget-class-with-prototype/#comment-80021</guid>
		<description>[...] found this little gem from Greg over at Graphics by Greg the other [...]</description>
		<content:encoded><![CDATA[<p>[...] found this little gem from Greg over at Graphics by Greg the other [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eli</title>
		<link>http://www.gregphoto.net/index.php/2006/08/30/creating-an-accordian-widget-class-with-prototype/comment-page-1/#comment-23739</link>
		<dc:creator>Eli</dc:creator>
		<pubDate>Wed, 13 Dec 2006 21:01:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.gregphoto.net/index.php/2006/08/30/creating-an-accordian-widget-class-with-prototype/#comment-23739</guid>
		<description>Cool function, I&#039;ve seen this done in a very much similar way: http://moofx.mad4milk.net/

P.S. Don&#039;t know if you intended it that way, but Accordion is spelled with an O. http://en.wikipedia.org/wiki/Accordion</description>
		<content:encoded><![CDATA[<p>Cool function, I&#8217;ve seen this done in a very much similar way: <a href="http://moofx.mad4milk.net/" rel="nofollow">http://moofx.mad4milk.net/</a></p>
<p>P.S. Don&#8217;t know if you intended it that way, but Accordion is spelled with an O. <a href="http://en.wikipedia.org/wiki/Accordion" rel="nofollow">http://en.wikipedia.org/wiki/Accordion</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: edward</title>
		<link>http://www.gregphoto.net/index.php/2006/08/30/creating-an-accordian-widget-class-with-prototype/comment-page-1/#comment-16536</link>
		<dc:creator>edward</dc:creator>
		<pubDate>Tue, 24 Oct 2006 17:42:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.gregphoto.net/index.php/2006/08/30/creating-an-accordian-widget-class-with-prototype/#comment-16536</guid>
		<description>Draggables in accordeon need workaround

Nice example of using the prototype. I just recently started playing with draggables etc. from Scriptaculous (http://wiki.script.aculo.us/scriptaculous/) also based on the same prototype.js and was looking for a way to put all those draggables in an accordeon.

I used your accordeon with great success. I had to alter it because in Firefox once I opened a section it remained open, although I already opened another session. The reason for this is that the heigth of the div that is defined inside the sections always &#039;reserves&#039; that height even if it not visible anymore (upon closure).
In your example that problem is not shown because you use overflow auto. 
I can not use it because then my draggables can not leave the accordeon, so I did a little workaround,
namely set the height to 1 px upon closeure and set it to auto upon opening as in the coder here.

	openSection: function(section) {
		var section = $(section);
		if(section.id != this.currentSection) {
			this.closeExistingSection();
			this.currentSection = section.id;
			var contents = document.getElementsByClassName(&#039;accord_contents&#039;,section);
			contents[0].show();
			contents[0].style.height=&quot;auto&quot;;
			contents[0].style.overflow = &quot;visible&quot;;
		}
	},
	closeExistingSection: function() {
		if(this.currentSection) {
			var contents = document.getElementsByClassName(&#039;accord_contents&#039;,this.currentSection);
			contents[0].style.height=&quot;1px&quot;;
			contents[0].style.overflow = &quot;auto&quot;;
	//		contents[0].hide(); // no need to hide anymore
		}
	}</description>
		<content:encoded><![CDATA[<p>Draggables in accordeon need workaround</p>
<p>Nice example of using the prototype. I just recently started playing with draggables etc. from Scriptaculous (<a href="http://wiki.script.aculo.us/scriptaculous/" rel="nofollow">http://wiki.script.aculo.us/scriptaculous/</a>) also based on the same prototype.js and was looking for a way to put all those draggables in an accordeon.</p>
<p>I used your accordeon with great success. I had to alter it because in Firefox once I opened a section it remained open, although I already opened another session. The reason for this is that the heigth of the div that is defined inside the sections always &#8216;reserves&#8217; that height even if it not visible anymore (upon closure).<br />
In your example that problem is not shown because you use overflow auto.<br />
I can not use it because then my draggables can not leave the accordeon, so I did a little workaround,<br />
namely set the height to 1 px upon closeure and set it to auto upon opening as in the coder here.</p>
<p>	openSection: function(section) {<br />
		var section = $(section);<br />
		if(section.id != this.currentSection) {<br />
			this.closeExistingSection();<br />
			this.currentSection = section.id;<br />
			var contents = document.getElementsByClassName(&#8216;accord_contents&#8217;,section);<br />
			contents[0].show();<br />
			contents[0].style.height=&#8221;auto&#8221;;<br />
			contents[0].style.overflow = &#8220;visible&#8221;;<br />
		}<br />
	},<br />
	closeExistingSection: function() {<br />
		if(this.currentSection) {<br />
			var contents = document.getElementsByClassName(&#8216;accord_contents&#8217;,this.currentSection);<br />
			contents[0].style.height=&#8221;1px&#8221;;<br />
			contents[0].style.overflow = &#8220;auto&#8221;;<br />
	//		contents[0].hide(); // no need to hide anymore<br />
		}<br />
	}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Greg</title>
		<link>http://www.gregphoto.net/index.php/2006/08/30/creating-an-accordian-widget-class-with-prototype/comment-page-1/#comment-15746</link>
		<dc:creator>Greg</dc:creator>
		<pubDate>Sat, 21 Oct 2006 20:00:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.gregphoto.net/index.php/2006/08/30/creating-an-accordian-widget-class-with-prototype/#comment-15746</guid>
		<description>@Hein - I think it is similar with internet explorer in that the header element click only seems to work when clicking the text part...even though it is a block level element.  The simple workaround is to use a div instead....</description>
		<content:encoded><![CDATA[<p>@Hein &#8211; I think it is similar with internet explorer in that the header element click only seems to work when clicking the text part&#8230;even though it is a block level element.  The simple workaround is to use a div instead&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hein</title>
		<link>http://www.gregphoto.net/index.php/2006/08/30/creating-an-accordian-widget-class-with-prototype/comment-page-1/#comment-15723</link>
		<dc:creator>Hein</dc:creator>
		<pubDate>Sat, 21 Oct 2006 14:31:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.gregphoto.net/index.php/2006/08/30/creating-an-accordian-widget-class-with-prototype/#comment-15723</guid>
		<description>Sorry, it works on Safari. (when clicking NEXT TO (left or right) but not ON the text element)</description>
		<content:encoded><![CDATA[<p>Sorry, it works on Safari. (when clicking NEXT TO (left or right) but not ON the text element)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hein</title>
		<link>http://www.gregphoto.net/index.php/2006/08/30/creating-an-accordian-widget-class-with-prototype/comment-page-1/#comment-15722</link>
		<dc:creator>Hein</dc:creator>
		<pubDate>Sat, 21 Oct 2006 14:23:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.gregphoto.net/index.php/2006/08/30/creating-an-accordian-widget-class-with-prototype/#comment-15722</guid>
		<description>Hi Greg, it works perfect with Firefox on OSX but it doesn&#039;t work with Safari.

Thanx for all the good articles.</description>
		<content:encoded><![CDATA[<p>Hi Greg, it works perfect with Firefox on OSX but it doesn&#8217;t work with Safari.</p>
<p>Thanx for all the good articles.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pi</title>
		<link>http://www.gregphoto.net/index.php/2006/08/30/creating-an-accordian-widget-class-with-prototype/comment-page-1/#comment-13850</link>
		<dc:creator>Pi</dc:creator>
		<pubDate>Sat, 07 Oct 2006 06:10:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.gregphoto.net/index.php/2006/08/30/creating-an-accordian-widget-class-with-prototype/#comment-13850</guid>
		<description>This is such a well written article. Thanks. Am going to explore this now. 

PS- Any chance you could get the scriptaculous cool sliding effects to make the windows slide open so that this is closer to the rico implementation?</description>
		<content:encoded><![CDATA[<p>This is such a well written article. Thanks. Am going to explore this now. </p>
<p>PS- Any chance you could get the scriptaculous cool sliding effects to make the windows slide open so that this is closer to the rico implementation?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

