<?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: Javascript Code to show a hidden element &#124; Display and Visibility</title>
	<atom:link href="http://blog.circlecube.com/2007/11/30/javascript-code-to-show-a-hidden-element/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.circlecube.com/2007/11/tutorial/javascript-code-to-show-a-hidden-element/</link>
	<description>Evan Mullins</description>
	<pubDate>Thu, 04 Dec 2008 22:59:52 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: David</title>
		<link>http://blog.circlecube.com/2007/11/tutorial/javascript-code-to-show-a-hidden-element/#comment-872</link>
		<dc:creator>David</dc:creator>
		<pubDate>Sun, 20 Jul 2008 08:13:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.circlecube.com/2007/12/01/javascript-code-to-show-a-hidden-element/#comment-872</guid>
		<description>Yes, that helped.  In short, title=* performs the same function as the alt=* property after an IMG tag in HTML, and is likewise optional.  Thanks.</description>
		<content:encoded><![CDATA[<p>Yes, that helped.  In short, title=* performs the same function as the alt=* property after an IMG tag in HTML, and is likewise optional.  Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Evan Mullins</title>
		<link>http://blog.circlecube.com/2007/11/tutorial/javascript-code-to-show-a-hidden-element/#comment-871</link>
		<dc:creator>Evan Mullins</dc:creator>
		<pubDate>Sat, 19 Jul 2008 22:07:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.circlecube.com/2007/12/01/javascript-code-to-show-a-hidden-element/#comment-871</guid>
		<description>@ David - Thanks! I'm guessing you're meaning title="Hide2" ?
I don't see any other place I use title... Title is just the text that appears when you hover over the link. 
The id has to be specific and that's how the script knows what to change and the class is just used for styles.
Hope that helps! =)</description>
		<content:encoded><![CDATA[<p>@ David - Thanks! I&#8217;m guessing you&#8217;re meaning title=&#8221;Hide2&#8243; ?<br />
I don&#8217;t see any other place I use title&#8230; Title is just the text that appears when you hover over the link.<br />
The id has to be specific and that&#8217;s how the script knows what to change and the class is just used for styles.<br />
Hope that helps! =)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://blog.circlecube.com/2007/11/tutorial/javascript-code-to-show-a-hidden-element/#comment-869</link>
		<dc:creator>David</dc:creator>
		<pubDate>Sat, 19 Jul 2008 02:35:34 +0000</pubDate>
		<guid isPermaLink="false">http://blog.circlecube.com/2007/12/01/javascript-code-to-show-a-hidden-element/#comment-869</guid>
		<description>Very useful script, which, unlike the one I had been using, works in Firefox. 

I have a question: How important is /title="Hide1"/ in your script?  I left it out, and its absence did not impair the running of the script at all.</description>
		<content:encoded><![CDATA[<p>Very useful script, which, unlike the one I had been using, works in Firefox. </p>
<p>I have a question: How important is /title=&#8221;Hide1&#8243;/ in your script?  I left it out, and its absence did not impair the running of the script at all.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: faolie</title>
		<link>http://blog.circlecube.com/2007/11/tutorial/javascript-code-to-show-a-hidden-element/#comment-704</link>
		<dc:creator>faolie</dc:creator>
		<pubDate>Tue, 01 Jul 2008 16:49:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.circlecube.com/2007/12/01/javascript-code-to-show-a-hidden-element/#comment-704</guid>
		<description>Hi, thanks. Quite simple really - here's what I used if anyone wants to know:

on (press) {

	import flash.external.*;
	ExternalInterface.call("toggleVisibility");
	}</description>
		<content:encoded><![CDATA[<p>Hi, thanks. Quite simple really - here&#8217;s what I used if anyone wants to know:</p>
<p>on (press) {</p>
<p>	import flash.external.*;<br />
	ExternalInterface.call(&#8221;toggleVisibility&#8221;);<br />
	}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Evan Mullins</title>
		<link>http://blog.circlecube.com/2007/11/tutorial/javascript-code-to-show-a-hidden-element/#comment-664</link>
		<dc:creator>Evan Mullins</dc:creator>
		<pubDate>Thu, 26 Jun 2008 17:45:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.circlecube.com/2007/12/01/javascript-code-to-show-a-hidden-element/#comment-664</guid>
		<description>@faolie- sure! It shouldn't be hard.
 I've already detailed actionscript and javascript communication, it should be simple to combine these two techniques into one for your project...
Check this post out: &lt;a href="http://blog.circlecube.com/2008/02/01/actionscript-javascript-communication/" rel="nofollow"&gt;Actionscript Javascript Communication &#124; ExternalInterface call and addCallback Tutorial&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>@faolie- sure! It shouldn&#8217;t be hard.<br />
 I&#8217;ve already detailed actionscript and javascript communication, it should be simple to combine these two techniques into one for your project&#8230;<br />
Check this post out: <a href="http://blog.circlecube.com/2008/02/01/actionscript-javascript-communication/"  rel="nofollow">Actionscript Javascript Communication | ExternalInterface call and addCallback Tutorial</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: faolie</title>
		<link>http://blog.circlecube.com/2007/11/tutorial/javascript-code-to-show-a-hidden-element/#comment-660</link>
		<dc:creator>faolie</dc:creator>
		<pubDate>Thu, 26 Jun 2008 09:16:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.circlecube.com/2007/12/01/javascript-code-to-show-a-hidden-element/#comment-660</guid>
		<description>Great post - clear and concise.
Can you help me take it further? Is it possible to pass the onclick from flash? For example, I have a flash movie, which when clicked turns a page. But I'd also like this click to  display a normal html menu. So I could use this post to do it (I think) but I'm not a flash guy though and I'm struggling to see the relationship between the actionscript and the javascript. Any pointers?

Thanks</description>
		<content:encoded><![CDATA[<p>Great post - clear and concise.<br />
Can you help me take it further? Is it possible to pass the onclick from flash? For example, I have a flash movie, which when clicked turns a page. But I&#8217;d also like this click to  display a normal html menu. So I could use this post to do it (I think) but I&#8217;m not a flash guy though and I&#8217;m struggling to see the relationship between the actionscript and the javascript. Any pointers?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Evan Mullins</title>
		<link>http://blog.circlecube.com/2007/11/tutorial/javascript-code-to-show-a-hidden-element/#comment-364</link>
		<dc:creator>Evan Mullins</dc:creator>
		<pubDate>Thu, 29 May 2008 17:47:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.circlecube.com/2007/12/01/javascript-code-to-show-a-hidden-element/#comment-364</guid>
		<description>@Susan-
Yes, each element needs it's own id, the above function is just for hiding/showing the specified id 'toggleMe' which is hard coded in the function. You can pass in an argument which would abstract the functionality of the function quite a bit: You pass in the specific element id you want to toggle.

[cc lang="javascript" tab_size="2" lines="40"]
function toggleSpecific(elementid) {
  var node = document.getElementById(elementid);
  if(node.style.display == '') {
    node.style.display='none';
  }
  else {
    node.style.display = '';
  }
}
[/cc]

And here's some html example for how to use it.

[cc lang="html" tab_size="2" lines="40"]
&lt;div onclick="toggleSpecific('hide1');"&gt;Click to Hide 1&lt;/div&gt;
&lt;div onclick="toggleSpecific('hide2');"&gt;Click to Hide 2&lt;/div&gt;
&lt;div onclick="toggleSpecific('hide1');toggleSpecific('hide2');"&gt;Click to Hide Both&lt;/div&gt;
&lt;div&gt;or using anchor tags: &lt;a href="javascript:toggleSpecific('hide2');" title="Hide2"&gt;Click this link to hide 2&lt;/a&gt;&lt;/div&gt;

&lt;div class="hide" id="hide1"&gt;Hide this one&lt;/div&gt;
&lt;div class="hide" id="hide2"&gt;Hide this too&lt;/div&gt;
[/cc]

Here, I've uploaded another example page: &lt;a href="/wp-content/uploads/2008/05/jsToggleSpecific.html" target="_blank" rel="nofollow"&gt;jsToggleSpecific.html&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>@Susan-<br />
Yes, each element needs it&#8217;s own id, the above function is just for hiding/showing the specified id &#8216;toggleMe&#8217; which is hard coded in the function. You can pass in an argument which would abstract the functionality of the function quite a bit: You pass in the specific element id you want to toggle.</p>
<div class="codecolorer-container javascript"><div class="codecolorer" style="font-family: monospace;"><ol><li class="li1"><div class="de1"><span class="kw2">function</span> toggleSpecific<span class="br0">&#40;</span>elementid<span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; <span class="kw2">var</span> node = document.<span class="me1">getElementById</span><span class="br0">&#40;</span>elementid<span class="br0">&#41;</span>;</div></li>
<li class="li1"><div class="de1">&nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>node.<span class="me1">style</span>.<span class="me1">display</span> == <span class="st0">''</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; node.<span class="me1">style</span>.<span class="me1">display</span>=<span class="st0">'none'</span>;</div></li>
<li class="li1"><div class="de1">&nbsp; <span class="br0">&#125;</span></div></li>
<li class="li1"><div class="de1">&nbsp; <span class="kw1">else</span> <span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; node.<span class="me1">style</span>.<span class="me1">display</span> = <span class="st0">''</span>;</div></li>
<li class="li1"><div class="de1">&nbsp; <span class="br0">&#125;</span></div></li>
<li class="li1"><div class="de1"><span class="br0">&#125;</span></div></li></ol></div></div>
<p>And here&#8217;s some html example for how to use it.</p>
<div class="codecolorer-container html"><div class="codecolorer" style="font-family: monospace;"><ol><li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;div</span> <span class="kw3">onclick</span>=<span class="st0">&quot;toggleSpecific('hide1');&quot;</span><span class="kw2">&gt;</span></span>Click to Hide 1<span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></div></li>
<li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;div</span> <span class="kw3">onclick</span>=<span class="st0">&quot;toggleSpecific('hide2');&quot;</span><span class="kw2">&gt;</span></span>Click to Hide 2<span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></div></li>
<li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;div</span> <span class="kw3">onclick</span>=<span class="st0">&quot;toggleSpecific('hide1');toggleSpecific('hide2');&quot;</span><span class="kw2">&gt;</span></span>Click to Hide Both<span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></div></li>
<li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;div&gt;</span></span>or using anchor tags: <span class="sc2"><span class="kw2">&lt;a</span> <span class="kw3">href</span>=<span class="st0">&quot;javascript:toggleSpecific('hide2');&quot;</span> <span class="kw3">title</span>=<span class="st0">&quot;Hide2&quot;</span><span class="kw2">&gt;</span></span>Click this link to hide 2<span class="sc2"><span class="kw2">&lt;/a&gt;</span></span><span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></div></li>
<li class="li1"><div class="de1">&nbsp;</div></li>
<li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;div</span> <span class="kw3">class</span>=<span class="st0">&quot;hide&quot;</span> <span class="kw3">id</span>=<span class="st0">&quot;hide1&quot;</span><span class="kw2">&gt;</span></span>Hide this one<span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></div></li>
<li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;div</span> <span class="kw3">class</span>=<span class="st0">&quot;hide&quot;</span> <span class="kw3">id</span>=<span class="st0">&quot;hide2&quot;</span><span class="kw2">&gt;</span></span>Hide this too<span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></div></li></ol></div></div>
<p>Here, I&#8217;ve uploaded another example page: <a href="/wp-content/uploads/2008/05/jsToggleSpecific.html" target="_blank" rel="nofollow">jsToggleSpecific.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Susan</title>
		<link>http://blog.circlecube.com/2007/11/tutorial/javascript-code-to-show-a-hidden-element/#comment-358</link>
		<dc:creator>Susan</dc:creator>
		<pubDate>Thu, 29 May 2008 04:27:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.circlecube.com/2007/12/01/javascript-code-to-show-a-hidden-element/#comment-358</guid>
		<description>I have the same issue that nOObie had -- I have multiple items I want to toggle the display on. I've changed the id so that they are each unique, but I don't know how to write the 'argument' when the function is called to make them work properly. Right now clicking on any of the 'toggle item' links makes just the last item toggle. Can anyone give me help?</description>
		<content:encoded><![CDATA[<p>I have the same issue that nOObie had &#8212; I have multiple items I want to toggle the display on. I&#8217;ve changed the id so that they are each unique, but I don&#8217;t know how to write the &#8216;argument&#8217; when the function is called to make them work properly. Right now clicking on any of the &#8216;toggle item&#8217; links makes just the last item toggle. Can anyone give me help?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Evan Mullins</title>
		<link>http://blog.circlecube.com/2007/11/tutorial/javascript-code-to-show-a-hidden-element/#comment-289</link>
		<dc:creator>Evan Mullins</dc:creator>
		<pubDate>Tue, 13 May 2008 18:12:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.circlecube.com/2007/12/01/javascript-code-to-show-a-hidden-element/#comment-289</guid>
		<description>I've updated the files to have toggleDisplay() and also toggleVisibility() functions. Let me know how it goes!</description>
		<content:encoded><![CDATA[<p>I&#8217;ve updated the files to have toggleDisplay() and also toggleVisibility() functions. Let me know how it goes!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Evan Mullins</title>
		<link>http://blog.circlecube.com/2007/11/tutorial/javascript-code-to-show-a-hidden-element/#comment-287</link>
		<dc:creator>Evan Mullins</dc:creator>
		<pubDate>Tue, 13 May 2008 17:28:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.circlecube.com/2007/12/01/javascript-code-to-show-a-hidden-element/#comment-287</guid>
		<description>Amandeep,
So you want to hide your column, but have it's place left blank?
I'd have to see your design to say which would be best, but there are a few ways you could do this: 
1. You could try having an empty column to be swapped out with the one you have content in when you hide/show the content. 
2. You could try changing the color to make the text invisible on the background but still hold it's place.
3. Maybe display=none isn't the style property you're looking for:  try swapping out the 'display: none;' with 'visibility: hidden;' and 'display=""' with 'visiblilty="visible"' Display is a property that will change the layout of the page, while visibility leaves the layout the same and hides the content.
Here's the source code

[cc lang="javascript" tab_size="2" lines="40"]
      function toggleVisibility() {
      if(document.getElementById("toggleMe").style.visibility == "hidden" ) {
      document.getElementById("toggleMe").style.visibility = "visible";
      }
      else {
      document.getElementById("toggleMe").style.visibility = "hidden";
      }
      }
[/cc]



[cc lang="html" tab_size="2" lines="40"]
      &lt;p onclick="toggleVisibility();"&gt;Click to toggle.&lt;/p&gt;
      &lt;p id="toggleMe" style="visibility: hidden"&gt; Something to Hide, but still affects layout.&lt;/p&gt;
[/cc]

</description>
		<content:encoded><![CDATA[<p>Amandeep,<br />
So you want to hide your column, but have it&#8217;s place left blank?<br />
I&#8217;d have to see your design to say which would be best, but there are a few ways you could do this:<br />
1. You could try having an empty column to be swapped out with the one you have content in when you hide/show the content.<br />
2. You could try changing the color to make the text invisible on the background but still hold it&#8217;s place.<br />
3. Maybe display=none isn&#8217;t the style property you&#8217;re looking for:  try swapping out the &#8216;display: none;&#8217; with &#8216;visibility: hidden;&#8217; and &#8216;display=&#8221;"&#8216; with &#8216;visiblilty=&#8221;visible&#8221;&#8216; Display is a property that will change the layout of the page, while visibility leaves the layout the same and hides the content.<br />
Here&#8217;s the source code</p>
<div class="codecolorer-container javascript"><div class="codecolorer" style="font-family: monospace;"><ol><li class="li1"><div class="de1"><span class="kw2">function</span> toggleVisibility<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>document.<span class="me1">getElementById</span><span class="br0">&#40;</span><span class="st0">&quot;toggleMe&quot;</span><span class="br0">&#41;</span>.<span class="me1">style</span>.<span class="me1">visibility</span> == <span class="st0">&quot;hidden&quot;</span> <span class="br0">&#41;</span> <span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; document.<span class="me1">getElementById</span><span class="br0">&#40;</span><span class="st0">&quot;toggleMe&quot;</span><span class="br0">&#41;</span>.<span class="me1">style</span>.<span class="me1">visibility</span> = <span class="st0">&quot;visible&quot;</span>;</div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; <span class="kw1">else</span> <span class="br0">&#123;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; document.<span class="me1">getElementById</span><span class="br0">&#40;</span><span class="st0">&quot;toggleMe&quot;</span><span class="br0">&#41;</span>.<span class="me1">style</span>.<span class="me1">visibility</span> = <span class="st0">&quot;hidden&quot;</span>;</div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div></li></ol></div></div>
<div class="codecolorer-container html"><div class="codecolorer" style="font-family: monospace;"><ol><li class="li1"><div class="de1"><span class="sc2"><span class="kw2">&lt;p</span> <span class="kw3">onclick</span>=<span class="st0">&quot;toggleVisibility();&quot;</span><span class="kw2">&gt;</span></span>Click to toggle.<span class="sc2"><span class="kw2">&lt;/p&gt;</span></span></div></li>
<li class="li1"><div class="de1">&nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;p</span> <span class="kw3">id</span>=<span class="st0">&quot;toggleMe&quot;</span> <span class="kw3">style</span>=<span class="st0">&quot;visibility: hidden&quot;</span><span class="kw2">&gt;</span></span> Something to Hide, but still affects layout.<span class="sc2"><span class="kw2">&lt;/p&gt;</span></span></div></li></ol></div></div>
]]></content:encoded>
	</item>
</channel>
</rss>
