<?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: Writing multiple toggle links in JQuery</title>
	<atom:link href="http://www.olliekav.com/2008/10/18/writing-multiple-toggle-links-in-jquery/feed" rel="self" type="application/rss+xml" />
	<link>http://www.olliekav.com/web-design/writing-multiple-toggle-links-in-jquery</link>
	<description>All things design, music and more...</description>
	<lastBuildDate>Tue, 09 Mar 2010 21:16:26 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Marco</title>
		<link>http://www.olliekav.com/web-design/writing-multiple-toggle-links-in-jquery/comment-page-1#comment-1090</link>
		<dc:creator>Marco</dc:creator>
		<pubDate>Thu, 25 Feb 2010 17:39:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.olliekav.com/?p=127#comment-1090</guid>
		<description>A demo would be useful! :)
I&#039;m struggling with the simplest part now: how to write the html code to hide / show the div?</description>
		<content:encoded><![CDATA[<p>A demo would be useful! <img src='http://www.olliekav.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
I&#8217;m struggling with the simplest part now: how to write the html code to hide / show the div?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://www.olliekav.com/web-design/writing-multiple-toggle-links-in-jquery/comment-page-1#comment-1085</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Mon, 22 Feb 2010 04:34:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.olliekav.com/?p=127#comment-1085</guid>
		<description>Thanks for the great example!

I have one small problem: if the anchor has more than one class, e.g. &lt;a class=&quot;link foo&quot;..., then &quot;[name^=value]&quot; does not work. Is there a work around for this?</description>
		<content:encoded><![CDATA[<p>Thanks for the great example!</p>
<p>I have one small problem: if the anchor has more than one class, e.g. &lt;a class=&quot;link foo&quot;&#8230;, then &quot;[name^=value]&quot; does not work. Is there a work around for this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://www.olliekav.com/web-design/writing-multiple-toggle-links-in-jquery/comment-page-1#comment-1077</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Fri, 27 Nov 2009 18:07:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.olliekav.com/?p=127#comment-1077</guid>
		<description>I see this in your code, and I&#039;ve seen other people do this with jquery too, but I don&#039;t understand why people do it.
&lt;code&gt;
var $this = $(this);
var x = $this.attr(&quot;className&quot;);
&lt;/code&gt;

what&#039;s the point of making the variable $this when it doesn&#039;t make the code smaller or more understandable.

why couldn&#039;t you just do this:
&lt;code&gt;
var x = ($this).attr(&quot;className&quot;);
&lt;/code&gt;
and leave out:
&lt;code&gt;var $this = $(this);&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>I see this in your code, and I&#8217;ve seen other people do this with jquery too, but I don&#8217;t understand why people do it.<br />
<code><br />
var $this = $(this);<br />
var x = $this.attr("className");<br />
</code></p>
<p>what&#8217;s the point of making the variable $this when it doesn&#8217;t make the code smaller or more understandable.</p>
<p>why couldn&#8217;t you just do this:<br />
<code><br />
var x = ($this).attr("className");<br />
</code><br />
and leave out:<br />
<code>var $this = $(this);</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: olliekav</title>
		<link>http://www.olliekav.com/web-design/writing-multiple-toggle-links-in-jquery/comment-page-1#comment-1036</link>
		<dc:creator>olliekav</dc:creator>
		<pubDate>Tue, 10 Nov 2009 00:25:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.olliekav.com/?p=127#comment-1036</guid>
		<description>Hi Violet,

Yes that does seem like a lot of duplicate code. I won&#039;t have a chance to look at this though as I am away travelling. Hopefully someone else can help you.</description>
		<content:encoded><![CDATA[<p>Hi Violet,</p>
<p>Yes that does seem like a lot of duplicate code. I won&#8217;t have a chance to look at this though as I am away travelling. Hopefully someone else can help you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: violet</title>
		<link>http://www.olliekav.com/web-design/writing-multiple-toggle-links-in-jquery/comment-page-1#comment-940</link>
		<dc:creator>violet</dc:creator>
		<pubDate>Wed, 04 Nov 2009 00:28:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.olliekav.com/?p=127#comment-940</guid>
		<description>Ok, first of all, awesome post. Second, I need some help...

I have 2 columns. On the left is where thumbnails will display, on the right are the links to show/hide div&#039;s on the left.

Ok, so you click on a link on the right, on the left a div appears. In the div are 4 thumb nails, you mouse over a thumbnail, and then a larger version appears.

Ok, so I DO have this working, however, I am having to duplicate a LOT of code each time I want to show/hide the divs and each time I want to show/hide thumbnail images. I consolidated my hidden divs, but I can&#039;t get the toggles to work doing something similar (as seen with multiple link tutorials).

Here is my code:
Javascript:
&lt;code&gt;
$(document).ready(function() {
  $(&#039;[id^=pwnbox]&#039;).hide();
  $(&#039;[id^=big]&#039;).hide();
  

  $(&#039;#toggle1&#039;).click(function() {
    $(&#039;#pwnbox1&#039;).slideToggle(400);
    $(&#039;#pwnbox2&#039;).hide(300);
    return false;
  });
  
  
  $(&#039;#toggle2&#039;).click(function() {
    $(&#039;#pwnbox2&#039;).slideToggle(400);
    $(&#039;#pwnbox1&#039;).hide(300);
    return false;
  });
  
  
  $(&#039;#togglebig1&#039;).mouseover(function() {
    $(&#039;#big1&#039;).show(400); 
    return false;
  }).mouseout(function() {
    $(&#039;#big1&#039;).hide(400);
    });
      $(&#039;#togglebig1-2&#039;).mouseover(function() {
    $(&#039;#big1-2&#039;).show(400); 
    return false;
  }).mouseout(function() {
    $(&#039;#big1-2&#039;).hide(400);
    });
      $(&#039;#togglebig1-3&#039;).mouseover(function() {
    $(&#039;#big1-3&#039;).show(400); 
    return false;
  }).mouseout(function() {
    $(&#039;#big1-3&#039;).hide(400);
    });
  $(&#039;#togglebig1-4&#039;).mouseover(function() {
    $(&#039;#big1-4&#039;).show(400); 
    return false;
  }).mouseout(function() {
    $(&#039;#big1-4&#039;).hide(400);
    });
    
    
     $(&#039;#togglebig2&#039;).mouseover(function() {
    $(&#039;#big2&#039;).show(400); 
    return false;
  }).mouseout(function() {
    $(&#039;#big2&#039;).hide(400);
    });

});
&lt;/code&gt;

My HTML code:

&lt;code&gt;

Mouseover a thumbnail to  view a larger image&lt;a href=&quot;#&quot; rel=&quot;nofollow&quot;&gt;&lt;/a&gt;&lt;a href=&quot;#&quot; rel=&quot;nofollow&quot;&gt;&lt;/a&gt;
&lt;a href=&quot;#&quot; rel=&quot;nofollow&quot;&gt;&lt;/a&gt;
&lt;a href=&quot;#&quot; rel=&quot;nofollow&quot;&gt;&lt;/a&gt;CHAMPION INDUSTRIAL CONTRACTORS, INC. has worked closely with Kaiser Permanente on numerous Medical Office Buildings throughout the Central Valley. Design/build projects include Medical Office Buildings in Manteca, Modesto, and Selma.


&lt;a href=&quot;#&quot; rel=&quot;nofollow&quot;&gt;&lt;/a&gt;CHAMPION INDUSTRIAL CONTRACTORS, INC. has worked closely with Kaiser Permanente on numerous Medical Office Buildings throughout the Central Valley. Design/build projects include Medical Office Buildings in Manteca, Modesto, and Selma.







Projects

	&lt;a href=&quot;#&quot; rel=&quot;nofollow&quot;&gt;Kaiser Permanente&lt;/a&gt;
	&lt;a href=&quot;#&quot; rel=&quot;nofollow&quot;&gt;Del Rio&lt;/a&gt;




&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Ok, first of all, awesome post. Second, I need some help&#8230;</p>
<p>I have 2 columns. On the left is where thumbnails will display, on the right are the links to show/hide div&#8217;s on the left.</p>
<p>Ok, so you click on a link on the right, on the left a div appears. In the div are 4 thumb nails, you mouse over a thumbnail, and then a larger version appears.</p>
<p>Ok, so I DO have this working, however, I am having to duplicate a LOT of code each time I want to show/hide the divs and each time I want to show/hide thumbnail images. I consolidated my hidden divs, but I can&#8217;t get the toggles to work doing something similar (as seen with multiple link tutorials).</p>
<p>Here is my code:<br />
Javascript:<br />
<code><br />
$(document).ready(function() {<br />
  $('[id^=pwnbox]').hide();<br />
  $('[id^=big]').hide();</p>
<p>  $('#toggle1').click(function() {<br />
    $('#pwnbox1').slideToggle(400);<br />
    $('#pwnbox2').hide(300);<br />
    return false;<br />
  });</p>
<p>  $('#toggle2').click(function() {<br />
    $('#pwnbox2').slideToggle(400);<br />
    $('#pwnbox1').hide(300);<br />
    return false;<br />
  });</p>
<p>  $('#togglebig1').mouseover(function() {<br />
    $('#big1').show(400);<br />
    return false;<br />
  }).mouseout(function() {<br />
    $('#big1').hide(400);<br />
    });<br />
      $('#togglebig1-2').mouseover(function() {<br />
    $('#big1-2').show(400);<br />
    return false;<br />
  }).mouseout(function() {<br />
    $('#big1-2').hide(400);<br />
    });<br />
      $('#togglebig1-3').mouseover(function() {<br />
    $('#big1-3').show(400);<br />
    return false;<br />
  }).mouseout(function() {<br />
    $('#big1-3').hide(400);<br />
    });<br />
  $('#togglebig1-4').mouseover(function() {<br />
    $('#big1-4').show(400);<br />
    return false;<br />
  }).mouseout(function() {<br />
    $('#big1-4').hide(400);<br />
    });</p>
<p>     $('#togglebig2').mouseover(function() {<br />
    $('#big2').show(400);<br />
    return false;<br />
  }).mouseout(function() {<br />
    $('#big2').hide(400);<br />
    });</p>
<p>});<br />
</code></p>
<p>My HTML code:</p>
<p><code></p>
<p>Mouseover a thumbnail to  view a larger image<a href="#" rel="nofollow"></a><a href="#" rel="nofollow"></a><br />
<a href="#" rel="nofollow"></a><br />
<a href="#" rel="nofollow"></a>CHAMPION INDUSTRIAL CONTRACTORS, INC. has worked closely with Kaiser Permanente on numerous Medical Office Buildings throughout the Central Valley. Design/build projects include Medical Office Buildings in Manteca, Modesto, and Selma.</p>
<p><a href="#" rel="nofollow"></a>CHAMPION INDUSTRIAL CONTRACTORS, INC. has worked closely with Kaiser Permanente on numerous Medical Office Buildings throughout the Central Valley. Design/build projects include Medical Office Buildings in Manteca, Modesto, and Selma.</p>
<p>Projects</p>
<p>	<a href="#" rel="nofollow">Kaiser Permanente</a><br />
	<a href="#" rel="nofollow">Del Rio</a></p>
<p></code></p>
]]></content:encoded>
	</item>
</channel>
</rss>
