<?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: More Showing, More Hiding</title>
	<atom:link href="http://www.learningjquery.com/2007/02/more-showing-more-hiding/feed" rel="self" type="application/rss+xml" />
	<link>http://www.learningjquery.com/2007/02/more-showing-more-hiding</link>
	<description>Tips, techniques, and tutorials for the jQuery JavaScript library</description>
	<lastBuildDate>Wed, 08 Feb 2012 13:50:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Thomas</title>
		<link>http://www.learningjquery.com/2007/02/more-showing-more-hiding/comment-page-3#comment-83425</link>
		<dc:creator>Thomas</dc:creator>
		<pubDate>Wed, 19 Jan 2011 23:42:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2007/02/more-showing-more-hiding#comment-83425</guid>
		<description>Hi there, I am looking for a way to make &quot;two actions&quot; happen and it doesn&#039; work.
These are the two actions:
1) when I click on a link, a div with ID abc should become visible. 
2) the initial link should become invisible.

So the div with ID abc is hidden at the start, no problem.
The link &lt;a id=&quot;trigger&quot;&gt; contains an href, when clicked it shows the div called abc, no problem. This is done using click(function and .show. 

But when I add a line to the the click(function to hide the a tag, it doesn&#039;t work: even worse: the initially hidden div abc is now shown when the page is loaded.
Somebody suggested that maybe this is because the a tag is an inline element, and not a block element, so it can&#039;t be hidden? (I know nothing about that).

So I subsequently tried to put a div tag with ID called xyz around (the paragraph containing) the &#039;trigger&#039; a tag, so I could try to make the div dissapear in stead of the a tag. I&#039;m not sure how to do this regarding syntax, or where to put it exactly, however, as I am completely new to jsquery. I&#039;ve tried several ways, but with the same sorry result: the target div abc is showing when the page is loaded, and it should be hidden, and the trigger is still showing after the click on the link.

This is what I&#039;ve written in the body:
&lt;pre&gt;&lt;code&gt;
&lt;div id=&quot;xyz&quot;&gt; &lt;div align=&quot;center&quot;&gt;
&lt;a id=&quot;showhidetrigger&quot; href=&quot;...&lt;/div&gt;
&lt;/div&gt;&lt;/code&gt;&lt;/pre&gt;

This what I&#039;ve written just before the /body
&lt;pre&gt;&lt;code&gt;

        $(document).ready(function () {
            $(&#039;#showhidetarget&#039;).hide();

            $(&#039;a#showhidetrigger&#039;).click(function () {
                $(&#039;#abc&#039;).show(200);
                $(‘#xyz’).hide();
            });
        });
    
&lt;/code&gt;&lt;/pre&gt;

I have not used (document).ready(function anywhere, it didn&#039;t seem necessary as everything works just fine, until I try to add the code to make the intial link dissapear...

I hope anybody can help?

Thanks in advance,

Thomas (Belgium)</description>
		<content:encoded><![CDATA[<p>Hi there, I am looking for a way to make &#8220;two actions&#8221; happen and it doesn&#8217; work.<br />
These are the two actions:<br />
1) when I click on a link, a div with ID abc should become visible.<br />
2) the initial link should become invisible.</p>
<p>So the div with ID abc is hidden at the start, no problem.<br />
The link &lt;a id=&#8221;trigger&#8221;&gt; contains an href, when clicked it shows the div called abc, no problem. This is done using click(function and .show. </p>
<p>But when I add a line to the the click(function to hide the a tag, it doesn&#8217;t work: even worse: the initially hidden div abc is now shown when the page is loaded.<br />
Somebody suggested that maybe this is because the a tag is an inline element, and not a block element, so it can&#8217;t be hidden? (I know nothing about that).</p>
<p>So I subsequently tried to put a div tag with ID called xyz around (the paragraph containing) the &#8216;trigger&#8217; a tag, so I could try to make the div dissapear in stead of the a tag. I&#8217;m not sure how to do this regarding syntax, or where to put it exactly, however, as I am completely new to jsquery. I&#8217;ve tried several ways, but with the same sorry result: the target div abc is showing when the page is loaded, and it should be hidden, and the trigger is still showing after the click on the link.</p>
<p>This is what I&#8217;ve written in the body:</p>
<pre><code>
<div id="xyz">
<div align="center">
&lt;a id=&quot;showhidetrigger&quot; href=&quot;...</div>
</div>

</code></pre>
<p>This what I&#8217;ve written just before the /body</p>
<pre><code>

        $(document).ready(function () {
            $('#showhidetarget').hide();

            $('a#showhidetrigger').click(function () {
                $('#abc').show(200);
                $(‘#xyz’).hide();
            });
        });

</code></pre>
<p>I have not used (document).ready(function anywhere, it didn&#8217;t seem necessary as everything works just fine, until I try to add the code to make the intial link dissapear&#8230;</p>
<p>I hope anybody can help?</p>
<p>Thanks in advance,</p>
<p>Thomas (Belgium)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: noob</title>
		<link>http://www.learningjquery.com/2007/02/more-showing-more-hiding/comment-page-3#comment-83423</link>
		<dc:creator>noob</dc:creator>
		<pubDate>Wed, 19 Jan 2011 09:59:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2007/02/more-showing-more-hiding#comment-83423</guid>
		<description>GREAT!!!
Thank you for you help :-)</description>
		<content:encoded><![CDATA[<p>GREAT!!!<br />
Thank you for you help :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl Swedberg</title>
		<link>http://www.learningjquery.com/2007/02/more-showing-more-hiding/comment-page-3#comment-83422</link>
		<dc:creator>Karl Swedberg</dc:creator>
		<pubDate>Tue, 18 Jan 2011 15:38:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2007/02/more-showing-more-hiding#comment-83422</guid>
		<description>Hi, 

The simplest way to hide the clicked element on click is to do &lt;code&gt;$(this).hide();&lt;/code&gt; inside the click handler.</description>
		<content:encoded><![CDATA[<p>Hi, </p>
<p>The simplest way to hide the clicked element on click is to do <code>$(this).hide();</code> inside the click handler.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: noob</title>
		<link>http://www.learningjquery.com/2007/02/more-showing-more-hiding/comment-page-3#comment-83421</link>
		<dc:creator>noob</dc:creator>
		<pubDate>Tue, 18 Jan 2011 15:08:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2007/02/more-showing-more-hiding#comment-83421</guid>
		<description>Great tut. I  had only one little question:
Is it possible to hide the h3 part onClick - so that only the hidden div is vissible?
Thanks for any help - (and sorry for my little bad english) :-)</description>
		<content:encoded><![CDATA[<p>Great tut. I  had only one little question:<br />
Is it possible to hide the h3 part onClick &#8211; so that only the hidden div is vissible?<br />
Thanks for any help &#8211; (and sorry for my little bad english) :-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: cyboman</title>
		<link>http://www.learningjquery.com/2007/02/more-showing-more-hiding/comment-page-3#comment-83329</link>
		<dc:creator>cyboman</dc:creator>
		<pubDate>Tue, 14 Dec 2010 13:59:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2007/02/more-showing-more-hiding#comment-83329</guid>
		<description>Great tutorial and js tool.  I&#039;m trying to switch the background image of the .demo-show h3 but I&#039;m unable to get it working.  Can you point me in the right direction?</description>
		<content:encoded><![CDATA[<p>Great tutorial and js tool.  I&#8217;m trying to switch the background image of the .demo-show h3 but I&#8217;m unable to get it working.  Can you point me in the right direction?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: m1shkk</title>
		<link>http://www.learningjquery.com/2007/02/more-showing-more-hiding/comment-page-3#comment-81892</link>
		<dc:creator>m1shkk</dc:creator>
		<pubDate>Sun, 19 Sep 2010 21:26:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2007/02/more-showing-more-hiding#comment-81892</guid>
		<description>Oh i like the 3rd variant most of all. thx</description>
		<content:encoded><![CDATA[<p>Oh i like the 3rd variant most of all. thx</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: fuller</title>
		<link>http://www.learningjquery.com/2007/02/more-showing-more-hiding/comment-page-3#comment-81195</link>
		<dc:creator>fuller</dc:creator>
		<pubDate>Thu, 29 Jul 2010 16:25:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2007/02/more-showing-more-hiding#comment-81195</guid>
		<description>i am such a beginner working on a project for school.. i would like to use the example where the paragraphs are independent -- can you help? like i do not know where to insert the code on the page etc. any step by step instructions would be amazingly helpful!</description>
		<content:encoded><![CDATA[<p>i am such a beginner working on a project for school.. i would like to use the example where the paragraphs are independent &#8212; can you help? like i do not know where to insert the code on the page etc. any step by step instructions would be amazingly helpful!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jquery Show and Hide Nested &#8216;s &#124; The Largest Forum Archive</title>
		<link>http://www.learningjquery.com/2007/02/more-showing-more-hiding/comment-page-3#comment-81127</link>
		<dc:creator>Jquery Show and Hide Nested &#8216;s &#124; The Largest Forum Archive</dc:creator>
		<pubDate>Tue, 27 Jul 2010 05:36:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2007/02/more-showing-more-hiding#comment-81127</guid>
		<description>[...] I would like to do is to incorporate this jquery tutorial into this list structure so that only one of the nested &lt;ul&gt;&#8217;s is [...]</description>
		<content:encoded><![CDATA[<p>[...] I would like to do is to incorporate this jquery tutorial into this list structure so that only one of the nested &lt;ul&gt;&#8217;s is [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: e11world</title>
		<link>http://www.learningjquery.com/2007/02/more-showing-more-hiding/comment-page-3#comment-81124</link>
		<dc:creator>e11world</dc:creator>
		<pubDate>Tue, 27 Jul 2010 00:45:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2007/02/more-showing-more-hiding#comment-81124</guid>
		<description>Along the lines of what&#039;s been said in this article, I have a small issue that I&#039;ve been trying to fix but with no success..
I&#039;m trying to basically replace the image btn-enter.png with btn-enter2.png when clicked but it isn&#039;t going back to btn-enter.png when I click again. The commented code shows that I&#039;m just switching the background image and I had that RIGHT AFTER the comma in &lt;code&gt;.slideToggle(1000,&quot;easeInOutExpo&quot;);&lt;/code&gt; but the problem was the the easing didn&#039;t happen since there was a function before it and the other way around didn&#039;t work either. Right now there isn&#039;t any css/image changing.
&lt;pre&gt;&lt;code&gt;
$(document).ready(function(){
		$(&quot;#overlay a&quot;).click(function(){
			$(&quot;#content&quot;).slideToggle(1000,&quot;easeInOutExpo&quot;);
		$(this).toggleClass(&quot;active&quot;);
			return false;
		});
		 //function() {$(&quot;#overlay a&quot;).css({&quot;background-image&quot;: &quot;url(btn-enter2.png)&quot;});
	});
&lt;/code&gt;&lt;/pre&gt;
&lt;code&gt;&lt;div id=&quot;overlay&quot;&gt;&lt;a href=&quot;#&quot;&gt;Slide it&lt;/a&gt;&lt;/div&gt;&lt;/code&gt;
I hope that makes sense and if not, I can post a sample.</description>
		<content:encoded><![CDATA[<p>Along the lines of what&#8217;s been said in this article, I have a small issue that I&#8217;ve been trying to fix but with no success..<br />
I&#8217;m trying to basically replace the image btn-enter.png with btn-enter2.png when clicked but it isn&#8217;t going back to btn-enter.png when I click again. The commented code shows that I&#8217;m just switching the background image and I had that RIGHT AFTER the comma in &lt;code&gt;.slideToggle(1000,&#8221;easeInOutExpo&#8221;);&lt;/code&gt; but the problem was the the easing didn&#8217;t happen since there was a function before it and the other way around didn&#8217;t work either. Right now there isn&#8217;t any css/image changing.<br />
&lt;pre&gt;&lt;code&gt;<br />
$(document).ready(function(){<br />
		$(&#8220;#overlay a&#8221;).click(function(){<br />
			$(&#8220;#content&#8221;).slideToggle(1000,&#8221;easeInOutExpo&#8221;);<br />
		$(this).toggleClass(&#8220;active&#8221;);<br />
			return false;<br />
		});<br />
		 //function() {$(&#8220;#overlay a&#8221;).css({&#8220;background-image&#8221;: &#8220;url(btn-enter2.png)&#8221;});<br />
	});<br />
&lt;/code&gt;&lt;/pre&gt;<br />
&lt;code&gt;&lt;div id=&#8221;overlay&#8221;&gt;&lt;a href=&#8221;#&#8221;&gt;Slide it&lt;/a&gt;&lt;/div&gt;&lt;/code&gt;<br />
I hope that makes sense and if not, I can post a sample.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason Jones</title>
		<link>http://www.learningjquery.com/2007/02/more-showing-more-hiding/comment-page-3#comment-81053</link>
		<dc:creator>Jason Jones</dc:creator>
		<pubDate>Wed, 21 Jul 2010 19:59:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.learningjquery.com/2007/02/more-showing-more-hiding#comment-81053</guid>
		<description>Many, many thanks!</description>
		<content:encoded><![CDATA[<p>Many, many thanks!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced (User agent is rejected)
Database Caching 7/23 queries in 0.009 seconds using disk: basic
Object Caching 372/383 objects using disk: basic
Content Delivery Network via learningjquery.kswedberg.netdna-cdn.com

Served from: www.learningjquery.com @ 2012-02-08 14:22:05 -->
