<?xml version="1.0" encoding="utf-8"?>
<feed
    xmlns="http://www.w3.org/2005/Atom"
    xmlns:at="http://www.sixapart.com/ns/at"
    xmlns:icbm="http://postneo.com/icbm"
    xmlns:rvw="http://purl.org/NET/RVW/0.2/"
    xml:lang="en">
    <title>vaniraja.com</title>
    <link rel="self" type="application/atom+xml" title="vaniraja.com (Atom)" href="http://vani.vox.com/library/posts/tags/js/page/1/atom.xml" />
    <link rel="alternate" type="text/html" title="vaniraja.com" href="http://vani.vox.com/library/posts/tags/js/page/1/"/> 
    <link rel="service.post" type="application/atom+xml" title="vaniraja.com" href="http://www.vox.com/services/atom/svc=post/collection_id=6a00c22520eeac604a00c22521e3d48e1d" /> 
    <link rel="service.subscribe" type="application/atom+xml" title="vaniraja.com" href="http://vani.vox.com/library/posts/tags/js/atom.xml" />   
    <link rel="last" type="application/atom+xml" title="vaniraja.com" href="http://vani.vox.com/library/posts/tags/js/page/1/atom.xml" />  
    <category term="js" scheme="http://vani.vox.com/tags/js/?_c=feed-atom-full" label="js" /> 
    <generator uri="http://www.vox.com/">Vox</generator>
    <updated>2009-08-14T15:33:18Z</updated> 
    <author>
        <name>Vani</name>
        <uri>http://vani.vox.com/?_c=feed-atom-full</uri>
    </author> 
    <id>tag:vox.com,2006:6p00c22520eeac604a/tags/js/</id> 
    <subtitle>the fresh-from-the-corner-market VOX edition.</subtitle>  
    
    <entry>
        <title>YUI: Simple show/hide div using Module</title>   
        <link rel="alternate" type="text/html" title="YUI: Simple show/hide div using Module" href="http://vani.vox.com/library/post/yui-simple-showhide-div-using-module.html?_c=feed-atom-full" />  
        <link rel="service.post" type="application/atom+xml" title="YUI: Simple show/hide div using Module" href="http://vani.vox.com/library/post/yui-simple-showhide-div-using-module.html?_c=feed-atom-full#comments" /> 
        <link rel="service.edit" type="application/atom+xml" title="YUI: Simple show/hide div using Module" href="http://www.vox.com/atom/svc=post/asset_id=6a00c22520eeac604a00d4141bb6e86a47" />          <id>tag:vox.com,2007-02-02:asset-6a00c22520eeac604a00d4141bb6e86a47</id>
        <published>2007-02-02T03:40:41Z</published>
        <updated>2009-08-14T15:33:18Z</updated>
    
        <author>
            <name>Vani</name>
            <uri>http://vani.vox.com/?_c=feed-atom-full</uri>
        </author>
    
        
        <content type="html" xml:base="http://vani.vox.com/?_c=feed-atom-full">
            <![CDATA[
                <div xmlns="http://www.w3.org/1999/xhtml" xmlns:at="http://www.sixapart.com/ns/at">
        <p><span style="color: #000000; font-size: 1em;"><strong>What you&#39;ll need from the <a href="http://developer.yahoo.com/yui/">Yahoo User Interface Library</a>:</strong><br />&#160;&#160;&#160; CSS: <a href="http://developer.yahoo.com/yui/reset/">reset</a>-<a href="http://developer.yahoo.com/yui/fonts/">fonts</a>-<a href="http://developer.yahoo.com/yui/grids/">grids</a>.css<br />&#160;&#160;&#160; Javascript: <a href="http://developer.yahoo.com/yui/yahoo/">yahoo</a>-<a href="http://developer.yahoo.com/yui/dom/">dom</a>-<a href="http://developer.yahoo.com/yui/event/">event</a>.js, <a href="http://developer.yahoo.com/yui/container/">container</a>.js</p><p><span style="font-size: 1.25em;"><span style="font-size: 1.25em;"><a href="http://developer.yahoo.com/yui/download/">Download</a> &#39;em all. </span></span></p><p><strong>Hop to it, campers! Call the YUI stuff first:</strong><br /></span><span style="color: #000000; font-size: 0.8em;"><br /></span><span style="font-size: 0.8em;"><em><span style="color: #000000; font-size: 1.25em;">&#160;&#160;&#160; &lt;link rel=&quot;stylesheet&quot; href=&quot;css/reset-fonts-grids.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; charset=&quot;utf-8&quot; /&gt;<br />&#160;&#160;&#160; &lt;script src=&quot;js/yahoo-dom-event.js&quot; type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;<br />&#160;&#160;&#160; &lt;script src=&quot;js/container.js&quot; type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;</span></em></span><span style="color: #000000; font-size: 1em;"><br /></span><span style="color: #000000; font-size: 1em;"><br /><strong>Add some styles for the prettiness factor. :o)</strong></span><span style="color: #000000; font-size: 1em;"></p><p><span style="font-size: 0.8em;"><em><span style="font-size: 1.25em;">&#160;&#160;&#160; &lt;style type=&quot;text/css&quot; media=&quot;screen&quot;&gt;<br />&#160;&#160;&#160; &#160;&#160;&#160; .container {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; width: 300px;<br />&#160;&#160;&#160; &#160;&#160;&#160; }</p><p>&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; .container h3 {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; font-size: 136%;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; font-weight: bold;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }</p><p>&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; .container h3 a {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; display: block;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; float: right;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; font-size: 77%;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; font-weight: normal;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; text-decoration: none;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }</p><p>&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160;&#160; .module {<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; padding: 5px;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; }<br />&#160;&#160;&#160; &lt;/style&gt;</span></em></span></p><p><strong>Apply YUI Javascript generously. <br /></strong><br /><span style="font-size: 0.8em;"><em><span style="font-size: 1.25em;">&#160;&#160;&#160; &lt;script type=&quot;text/javascript&quot; charset=&quot;utf-8&quot;&gt;<br />&#160;&#160;&#160; YAHOO.namespace(&quot;cats.container&quot;);</p><p>&#160;&#160;&#160; function init() {<br />&#160;&#160;&#160; &#160;&#160;&#160; YAHOO.cats.container.module = new YAHOO.widget.Module(&quot;module&quot;);<br />&#160;&#160;&#160; &#160;&#160;&#160; YAHOO.cats.container.show = new YAHOO.widget.Module(&quot;show&quot;);<br />&#160;&#160;&#160; &#160;&#160;&#160; YAHOO.cats.container.hide = new YAHOO.widget.Module(&quot;hide&quot;);<br />&#160;&#160;&#160; &#160;&#160;&#160; YAHOO.cats.container.module.render();</p><p>&#160;&#160;&#160; &#160;&#160;&#160; YAHOO.util.Event.addListener(&quot;show&quot;, &quot;click&quot;, YAHOO.cats.container.module.show, YAHOO.cats.container.module, true);<br />&#160;&#160;&#160; &#160;&#160;&#160; YAHOO.util.Event.addListener(&quot;show&quot;, &quot;click&quot;, YAHOO.cats.container.hide.show, YAHOO.cats.container.hide, true);<br />&#160;&#160;&#160; &#160;&#160;&#160; YAHOO.util.Event.addListener(&quot;show&quot;, &quot;click&quot;, YAHOO.cats.container.show.hide, YAHOO.cats.container.show, true);&#160;&#160;&#160; <br />&#160;&#160;&#160; &#160;&#160;&#160; YAHOO.util.Event.addListener(&quot;hide&quot;, &quot;click&quot;, YAHOO.cats.container.module.hide, YAHOO.cats.container.module, true);<br />&#160;&#160;&#160; &#160;&#160;&#160; YAHOO.util.Event.addListener(&quot;hide&quot;, &quot;click&quot;, YAHOO.cats.container.show.show, YAHOO.cats.container.show, true);<br />&#160;&#160;&#160; &#160;&#160;&#160; YAHOO.util.Event.addListener(&quot;hide&quot;, &quot;click&quot;, YAHOO.cats.container.hide.hide, YAHOO.cats.container.hide, true);<br />&#160;&#160;&#160; }</p><p>&#160;&#160;&#160; YAHOO.util.Event.addListener(window, &quot;load&quot;, init);<br />&#160;&#160;&#160; &lt;/script&gt;</span></em></span></p><p><strong>And the HTML. (Try holding your breath - it&#39;s really that quick!)</strong></p><p>&#160;<span style="font-size: 0.8em;">&#160;<em><span style="font-size: 1.25em;">&#160; &lt;div class=&quot;container&quot;&gt;<br />&#160;&#160;&#160; &#160;&#160;&#160; &lt;h3&gt;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &lt;a href=&quot;#&quot; id=&quot;show&quot; style=&quot;display: none;&quot;&gt;Show&lt;/a&gt;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &lt;a href=&quot;#&quot; id=&quot;hide&quot;&gt;Hide&lt;/a&gt;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; Header<br />&#160;&#160;&#160; &#160;&#160;&#160; &lt;/h3&gt;<br />&#160;&#160;&#160; &#160;&#160;&#160; &lt;div id=&quot;module&quot; class=&quot;module&quot;&gt;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &lt;div class=&quot;bd&quot;&gt;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &lt;ul&gt;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &lt;li&gt;&lt;input type=&quot;checkbox&quot; name=&quot;some_name&quot; value=&quot;&quot; id=&quot;some_name&quot; /&gt; &amp;nbsp;Lorem ipsum dolor sit amet&lt;/li&gt;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &lt;li&gt;&lt;input type=&quot;checkbox&quot; name=&quot;some_name&quot; value=&quot;&quot; id=&quot;some_name&quot; /&gt; &amp;nbsp;Lorem ipsum dolor sit amet&lt;/li&gt;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &lt;li&gt;&lt;input type=&quot;checkbox&quot; name=&quot;some_name&quot; value=&quot;&quot; id=&quot;some_name&quot; /&gt; &amp;nbsp;Lorem ipsum dolor sit amet&lt;/li&gt;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &lt;li&gt;&lt;input type=&quot;checkbox&quot; name=&quot;some_name&quot; value=&quot;&quot; id=&quot;some_name&quot; /&gt; &amp;nbsp;Lorem ipsum dolor sit amet&lt;/li&gt;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &lt;li&gt;&lt;input type=&quot;checkbox&quot; name=&quot;some_name&quot; value=&quot;&quot; id=&quot;some_name&quot; /&gt; &amp;nbsp;Lorem ipsum dolor sit amet&lt;/li&gt;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &lt;/ul&gt;<br />&#160;&#160;&#160; &#160;&#160;&#160; &#160;&#160;&#160; &lt;/div&gt; &lt;!-- end .bd --&gt;<br />&#160;&#160;&#160; &#160;&#160;&#160; &lt;/div&gt; &lt;!-- end .module --&gt;<br />&#160;&#160;&#160; &lt;/div&gt;&#160;&#160;&#160; &lt;!-- end .container --&gt;</p></span></em><p><span style="font-size: 1.25em;"><strong>And you&#39;re done! Easier than a soft-boiled egg.&#160;</strong></span><em><span style="font-size: 1.25em;"> <br /></span></em></span><br /></span> </p>   <p style="clear:both;"> 
    <a href="http://vani.vox.com/library/post/yui-simple-showhide-div-using-module.html?_c=feed-atom-full#comments">Read and post comments</a>   |   
    <a href="http://www.vox.com/share/6a00c22520eeac604a00d4141bb6e86a47?_c=feed-atom-full">Send to a friend</a> 
</p>

                </div>
            ]]>
        </content> 
    <category term="css" scheme="http://vani.vox.com/tags/css/" label="css" /> 
    <category term="javascript" scheme="http://vani.vox.com/tags/javascript/" label="javascript" /> 
    <category term="js" scheme="http://vani.vox.com/tags/js/" label="js" /> 
    <category term="yui" scheme="http://vani.vox.com/tags/yui/" label="yui" /> 
    </entry> 
</feed>


