<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.2.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>pootato.org &#187; Javascript</title>
	<link>http://pootato.org</link>
	<description>Tutorials for your website</description>
	<pubDate>Tue, 22 Jul 2008 01:05:40 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>
	<language>en</language>
			<item>
		<title>Auto detect image link for lightbox</title>
		<link>http://pootato.org/tutorials/javascript/auto-detect-image-link-for-lightbox/</link>
		<comments>http://pootato.org/tutorials/javascript/auto-detect-image-link-for-lightbox/#comments</comments>
		<pubDate>Thu, 16 Aug 2007 21:14:13 +0000</pubDate>
		<dc:creator>Clara</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://pootato.org/tutorials/javascript/auto-detect-image-link-for-lightbox/</guid>
		<description><![CDATA[With jQuery
Using jQuery and interface imagebox plugin, we need to add rel=&#034;imagebox&#034; to our image link. If you don&#039;t want to add this manually to all your pictures like me, here is a little solution I&#039;ve found. Insert this between &#60;head&#62; and &#60;/head&#62;.
&#60;script type="text/javascript"&#62;
$(document).ready(function() {
$('a[@href$=jpg]&#039;).attr(&#034;rel&#034;,&#034;imagebox&#034;);
});
&#60;/script&#62; 
This will find all links to .jpg files and add [...]]]></description>
			<content:encoded><![CDATA[<h2>With jQuery</h2>
<p>Using <a href="http://jquery.com" target="_blank">jQuery</a> and <a href="http://interface.eyecon.ro/" target="_blank">interface</a> imagebox plugin, we need to add <samp>rel=&#034;imagebox&#034;</samp> to our image link. If you don&#039;t want to add this manually to all your pictures like me, here is a little solution I&#039;ve found. Insert this between &lt;head&gt; and &lt;/head&gt;.</p>
<p><code>&lt;script type="text/javascript"&gt;<br />
$(document).ready(function() {<br />
$('<strong>a[@href$=jpg]</strong>&#039;).attr(&#034;<em>rel</em>&#034;,&#034;<em>imagebox</em>&#034;);<br />
});<br />
&lt;/script&gt; </code></p>
<p>This will find all links to .jpg files and add <samp>rel=&#034;imagebox&#034;</samp> to them.</p>
<h2>With Mootools</h2>
<p><strong>Edit:</strong> In the end, I&#039;m not sure this will work!</p>
<p>Here is a snippet I use for <a href="http://mootools.net/" target="_blank">Mootools</a> and <a href="http://www.digitalia.be/software/slimbox" target="_blank">Slimbox</a> plugin. With Slimbox, we need to add <samp>rel=&#034;lightbox&#034;</samp> to our image link. In a javascript file, paste this code:</p>
<p><code> function autoLightbox()<br />
{<br />
var anchors = document.getElementsByTagName("a");<br />
var imgex = /\.(jpg|jpeg|gif|png|bmp)$/;<br />
for (var i = 0; i &lt; anchors.length; i++){<br />
var anchor = anchors[i];<br />
if (anchor.getAttribute('href') &amp;&amp; (anchor.getAttribute('href').toLowerCase().search(imgex) &gt;= 0)){<br />
anchor.setAttribute('rel', 'lightbox');<br />
}<br />
}<br />
}<br />
window.addEvent('domready', function(){ autoLightbox();}) </code></p>
<p><del>This should work. There are probably better ways to do this using Mootools but I&#039;ve dropped this library for jQuery. ^^;</del></p>
<p class="akst_link"><a href="http://pootato.org/?p=62&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_62" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://pootato.org/tutorials/javascript/auto-detect-image-link-for-lightbox/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Accordion menu with Mootools</title>
		<link>http://pootato.org/tutorials/javascript/accordion-menu-with-mootools/</link>
		<comments>http://pootato.org/tutorials/javascript/accordion-menu-with-mootools/#comments</comments>
		<pubDate>Wed, 15 Aug 2007 01:37:21 +0000</pubDate>
		<dc:creator>Clara</dc:creator>
		
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://pootato.org/tutorials/javascript/accordion-menu-with-mootools/</guid>
		<description><![CDATA[Here is what we&#039;ll do. You first have to download mootools.js.
Let&#039;s take care of the HTML codes for the menu first&#8230;
&#60;div id="accordion"&#62;
&#60;h1 class="toggler"&#62;Lorem&#60;/h1&#62;
&#60;div class="stretch"&#62;
&#60;p&#62;Text 1 goes here&#60;/p&#62;
&#60;/div&#62;
&#60;h1 class="toggler"&#62;Ipsum&#60;/h1&#62;
&#60;div class="stretch"&#62;
&#60;p&#62;Text 2 goes here&#60;/p&#62;
&#60;/div&#62;
&#60;/div&#62;
Now let&#039;s link the script to your page, add this code between head tags:
 &#60;script src="mootools.js&#034; type=&#034;text/javascript&#034; language=&#034;JavaScript&#034;&#62;&#60;/script&#62; 
Now, we need to write the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="/examples/accordion.htm" target="_blank">Here</a> is what we&#039;ll do. You first have to download <a href="http://mootools.net/" target="_blank">mootools.js</a>.</p>
<p>Let&#039;s take care of the HTML codes for the menu first&#8230;</p>
<p><code>&lt;div id="accordion"&gt;<br />
&lt;h1 class="toggler"&gt;Lorem&lt;/h1&gt;<br />
&lt;div class="stretch"&gt;<br />
&lt;p&gt;Text 1 goes here&lt;/p&gt;<br />
&lt;/div&gt;<br />
&lt;h1 class="toggler"&gt;Ipsum&lt;/h1&gt;<br />
&lt;div class="stretch"&gt;<br />
&lt;p&gt;Text 2 goes here&lt;/p&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;</code></p>
<p>Now let&#039;s link the script to your page, add this code between <samp>head</samp> tags:</p>
<p><code> &lt;script src="<strong>mootools.js</strong>&#034; type=&#034;text/javascript&#034; language=&#034;JavaScript&#034;&gt;&lt;/script&gt; </code></p>
<p>Now, we need to write the javascript to make your accordion menu. Add it directly to your source in the head part:</p>
<p><code> &lt;script type="text/javascript" language="JavaScript"&gt;<br />
window.addEvent('domready', function() {<br />
var accordion = new Accordion('h1.toggler', 'div.stretch', $('accordion'));<br />
});<br />
&lt;/script&gt; </code></p>
<p>You&#039;re done! Test it and style it with CSS now!</p>
<p>Note: There is a file embedded within this post, please visit this post to download the file.</p>
<p class="akst_link"><a href="http://pootato.org/?p=27&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_27" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://pootato.org/tutorials/javascript/accordion-menu-with-mootools/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
