<?xml version="1.0" encoding="UTF-8"?>
<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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>jek2kdotcom &#187; Javascript</title>
	<atom:link href="http://www.jek2k.com/wp/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jek2k.com/wp</link>
	<description>still awake at night?</description>
	<lastBuildDate>Thu, 12 May 2011 10:33:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>MooTools icons scroller</title>
		<link>http://www.jek2k.com/wp/2009/02/13/mootools-icons-scroller/</link>
		<comments>http://www.jek2k.com/wp/2009/02/13/mootools-icons-scroller/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 10:30:52 +0000</pubDate>
		<dc:creator>Nicolò</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[MooTools]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.jek2k.com/wp/?p=216</guid>
		<description><![CDATA[
Some time ago I was trying to make a project/icons scroller, to refresh our online portfolio. The idea was having two rows of icons to scroll with a little delay and an elastic effect. Of course, I didn&#8217;t want to use Flash for this, so I went for MooTools.

I&#8217;ve never implemented this script on our [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-217" title="project_matrix" src="http://www.jek2k.com/wp/wp-content/uploads/2009/01/project_matrix.jpg" alt="project_matrix" width="480" height="230" /></p>
<p>Some time ago I was trying to make a project/icons scroller, to refresh our online portfolio. The idea was having two rows of icons to scroll with a little delay and an elastic effect. Of course, I didn&#8217;t want to use Flash for this, so I went for MooTools.<br />
<span id="more-216"></span><br />
I&#8217;ve never implemented this script on our site and the script itself it quite basic and unoptimized. However I thought of sharing it here, with the hope it might be helpful to someone out there.</p>
<p><a href="http://playground.gnvpartners.net/ex/project_scroller/">See a working example</a></p>
<p><a href="http://playground.gnvpartners.net/ex/project_scroller/project_scroller.zip">Download the source code</a> (51k ZIP)</p>
<p class="note">This tutorial is provided as is. Please do not email me questions or support requests about the scripts contained in this page. Use the comments below instead. Thank you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jek2k.com/wp/2009/02/13/mootools-icons-scroller/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Drop down with MooTools</title>
		<link>http://www.jek2k.com/wp/2008/01/20/drop-down-with-mootools/</link>
		<comments>http://www.jek2k.com/wp/2008/01/20/drop-down-with-mootools/#comments</comments>
		<pubDate>Sun, 20 Jan 2008 20:23:27 +0000</pubDate>
		<dc:creator>Nicolò</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.jek2k.com/wp/index.php/2008/01/20/drop-down-with-mootools/</guid>
		<description><![CDATA[Last year, when I launched this version of Jek2k.com, I published a tutorial on how to make drop-down panels like the ones on this site.
As some of you might have noticed, since last month I&#8217;ve changed the JavaScripts on this site. I&#8217;ve swtiched to MooTools. I&#8217;ve used it quite often in my latest projects and [...]]]></description>
			<content:encoded><![CDATA[<p>Last year, when I launched this version of Jek2k.com, <a href="http://www.jek2k.com/wp/index.php/2006/07/14/drop-down-with-javascript/">I published a tutorial on how to make drop-down panels</a> like the ones on this site.</p>
<p>As some of you might have noticed, since last month I&#8217;ve changed the JavaScripts on this site. I&#8217;ve swtiched to <a href="http://mootools.net">MooTools</a>. I&#8217;ve used it quite often in my latest projects and I must say I&#8217;m finding it pretty easy to use.</p>
<p>For all those who liked the old drop-down script, I&#8217;m now posting an updated version with a short tutorial.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>1. Wrap everything inside a DOM Ready Event.</p>
<pre class="brush: jscript;">
window.addEvent('domready', function() {
	// CODE HERE

});
 </pre>
<p>2. Define which Html element (&#8221;myPanel&#8221;) will be affected by the drop-down effect. You might want to hide it, so that it starts collapsed.</p>
<pre class="brush: jscript;">
var mySlide = new Fx.Slide('myPanel');
mySlide.hide();
 </pre>
<p>3. The following lines add a Click event to the &#8220;Open Panel&#8221; link and add desired effect to open the drop-down panel, fade-out the &#8220;Open Panel&#8221; link and fade in the &#8220;Close Panel&#8221; link.</p>
<pre class="brush: jscript;">
var fx = new Fx.Styles($('openPanel'), {duration:500, wait:false});
$('openPanel').addEvent('click', function(e){
   mySlide.toggle();
 	fx.start({
   	'opacity': 0
   }).chain(function(){
     	$('openPanel').setStyle('display', 'none');
       $('closePanel').setStyle('display', 'block');
       $('closePanel').setStyle('opacity', '0');
       fx1.start({
           'opacity': 1
       });
   });
});
 </pre>
<p>4. Lastly, we need some other code to handle the &#8220;Close Panel&#8221; link, which mirrors the code above.</p>
<pre class="brush: jscript;">
var fx1 = new Fx.Styles($('closePanel'), {duration:500, wait:false});
$('closePanel').addEvent('click', function(e){
	mySlide.toggle();
   fx1.start({
   	'opacity': 0
  	}).chain(function(){
   	$('openPanel').setStyle('display', 'block');
      	$('closePanel').setStyle('display', 'none');
       $('openPanel').setStyle('opacity', '0');
       fx.start({
       	'opacity': 1
       });
   });
});
 </pre>
<p>Please see also <a href="http://docs.mootools.net/">MooTools own documentation</a> and <a href="http://demos.mootools.net/">demos</a> for the <a href="http://demos.mootools.net/Fx.Slide">Fx.Slide</a> and the <a href="http://demos.mootools.net/Fx.Styles">Fx.Styles</a> behaviours.</p>
<p><a title="Download dropdown_js.zip" href="http://www.jek2k.com/wp/wp-content/uploads/2008/01/dropdown_js.zip">Download the Source Code</a> (24k ZIP)</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p><strong>Updated on 22.01.2008</strong><br />
Today my friend <a href="http://www.luscarpa.eu/">Luca</a>, who is a pro developer, emailed me a modified version of the above script, that he has kindly corrected and improved. He also has shortened the script, making it a lot easier.</p>
<pre class="brush: jscript;">
window.addEvent('domready', function() {
	// Label for link
	var labelOpen='Open Panel';
	var labelClose='Close Panel';

	// Set slide and styles effects
	var mySlide = new Fx.Slide('myPanel').hide();
	var fx = new Fx.Styles($('linkPanel'), {duration:500, wait:false});
	$('linkPanel').addEvent('click', function(e){
		mySlide.toggle();
		$('linkPanel').toggleClass('openPanel');
		fx.start({
			'opacity': 0
		}).chain(function(){
			if($('linkPanel').hasClass('openPanel')) $('linkPanel').setHTML(labelClose);
			else $('linkPanel').setHTML(labelOpen);
			fx.start({'opacity': 1})
		});
	});
});
 </pre>
<p>Below is the link to download Luca&#8217;s new version:</p>
<p><a title="Download dropdown_js_v2.0.zip" href="http://www.jek2k.com/wp/wp-content/uploads/2008/01/dropdown_js_v2.0.zip">Download the new Source Code</a> (24k ZIP)</p>
<p class="note">This tutorial is provided as is. Please do not email me questions or support requests about the scripts contained in this page. Use the comments below instead. Thank you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jek2k.com/wp/2008/01/20/drop-down-with-mootools/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Multiple drop-downs</title>
		<link>http://www.jek2k.com/wp/2006/12/20/multiple-drop-downs/</link>
		<comments>http://www.jek2k.com/wp/2006/12/20/multiple-drop-downs/#comments</comments>
		<pubDate>Wed, 20 Dec 2006 21:16:52 +0000</pubDate>
		<dc:creator>Nicolò</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.jek2k.com/wp/index.php/2006/12/20/multiple-drop-downs/</guid>
		<description><![CDATA[This is a followup to my previous JavaScript tutorial (Italian version can be found here).
Many people asked for multiple drop-downs panels within one page or multiple links to open/close a single drop-down panel.
I made a little variation to the original script to cover both cases.
Hope this helps.
Download the Source Code (28k ZIP).
This tutorial is provided [...]]]></description>
			<content:encoded><![CDATA[<p>This is a followup to <a href="http://www.jek2k.com/wp/index.php/2006/07/14/drop-down-with-javascript/">my previous JavaScript tutorial</a> (Italian version can be found <a href="http://www.jek2k.com/wp/index.php/2006/06/10/drop-down-con-javascript/">here</a>).</p>
<p>Many people asked for multiple drop-downs panels within one page or multiple links to open/close a single drop-down panel.</p>
<p>I made a little variation to the original script to cover both cases.<br />
Hope this helps.</p>
<p><a href="http://www.jek2k.com/wp/wp-content/uploads/2006/12/multiple_drop_down_js.zip">Download the Source Code</a> (28k ZIP).</p>
<p class="note">This tutorial is provided as is. Please do not email me questions or support requests about the scripts contained in this page. Use the comments below instead. Thank you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jek2k.com/wp/2006/12/20/multiple-drop-downs/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Drop down with Javascript (EN)</title>
		<link>http://www.jek2k.com/wp/2006/07/14/drop-down-with-javascript/</link>
		<comments>http://www.jek2k.com/wp/2006/07/14/drop-down-with-javascript/#comments</comments>
		<pubDate>Fri, 14 Jul 2006 20:58:59 +0000</pubDate>
		<dc:creator>Nicolò</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.jek2k.com/wp/index.php/2006/07/14/drop-down-with-javascript/</guid>
		<description><![CDATA[*Can* asked me to translate my previous tutorial. So here it is!
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;
How the heck did I make the drop down panel above?
Ok, maybe it&#8217;s a kids game for some of you, but I guess  there&#8217;s someone out there who might be interested. For these (few) people, here&#8217;s the tute.
This is all web standards compliant, [...]]]></description>
			<content:encoded><![CDATA[<p>*Can* asked me to translate my previous tutorial. So here it is!<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>How the heck did I make the drop down panel above?<br />
Ok, maybe it&#8217;s a kids game for some of you, but I guess  there&#8217;s someone out there who might be interested. For these (few) people, here&#8217;s the tute.</p>
<p>This is all <em>web standards compliant</em>, keeping my Xhtml clean and valid, and so my Css stylesheet.<br />
The interaction is built using some very useful (and yet very well-knowed)  free Javascript libraries, released under a GPL license.<br />
To be specific, you will need the following libraries:</p>
<ul>
<li><a href="http://prototype.conio.net/">Prototype</a></li>
<li><a href="http://script.aculo.us/">Script.aculo.us</a></li>
<li><a href="http://bennolan.com/behaviour/">Behaviour</a></li>
</ul>
<p>that you can download from their respective web sites.<br />
<span id="more-45"></span><br />
So, now that we got the libraries, let&#8217;s include them in our Html document, this way:<br />
<pre><pre>
&lt;script type=&quot;text/javascript&quot; src=&quot;/js/prototype.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;/js/scriptaculous.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;/js/behaviour.js&quot;&gt;&lt;/script&gt;
</pre></pre><br />
Obviously, you have to modify the paths to match your site/server strcture. Then, we have to set up the 2 elements involved in the interaction: the link that activates/deactivates the drop down animation and the Div with the drop down content.</p>
<p>Let&#8217;s start with the link:<br />
<pre><pre>
&lt;a id=&quot;open&quot; href=&quot;javascript:void(0);&quot; &gt;Open&lt;/a&gt; 
&lt;a id=&quot;close&quot; href=&quot;javascript:void(0);&quot; style=&quot;display:none;&quot;&gt;Close&lt;/a&gt; 
</pre></pre><br />
Elements IDs are very important, we&#8217;ll discover why very soon.<br />
Now let&#8217;s create the Div with the content and call it <strong>contents</strong>:<br />
<pre><pre>
&lt;div id=&quot;contents&quot; style=&quot;display:none;&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp; bla bla bla bla bla bla
&lt;/div&gt; 
</pre></pre></p>
<p>Now, normally, to give a link a Javascript behaviour you would use the <strong>onclick</strong> tag attribute.<br />
However, it&#8217;s a old and dirty way to manage Javascript behaviours, which might also cause validation problems.<br />
So, we&#8217;re not gonna use it anymore!</p>
<p><a href="http://bennolan.com/behaviour/">Behaviour</a> comes in our help, giving us a clean method to add Javascript behaviours to Html elements, using Css selectors.<br />
We have to define some rules, as follows:<br />
<pre><pre>
// Rules
var myrules = {
&nbsp;&nbsp;&#039;#open&#039; : function(element){
&nbsp;&nbsp;&nbsp;&nbsp;element.onclick = function(){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var targetDiv = $(&#039;contents&#039;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new Effect.BlindDown(targetDiv,{duration: 0.5});
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new Effect.Fade(this);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Effect.Appear(&#039;close&#039;, {delay: 1});
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;},
&nbsp;&nbsp;&#039;#close&#039; : function(element){
&nbsp;&nbsp;&nbsp;&nbsp;element.onclick = function(){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var targetDiv = $(&#039;contents&#039;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new Effect.BlindUp(targetDiv,{duration: 0.5});
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new Effect.Fade(this); 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Effect.Appear(&#039;open&#039;, {delay: 1});
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;}
};
</pre></pre><br />
Save this JS to a file named <strong>rules.js</strong> and include it in the Html document.<br />
<pre><pre>
&lt;script type=&quot;text/javascript&quot; src=&quot;/js/rules.js&quot;&gt;&lt;/script&gt;
</pre></pre><br />
The code uses also the libraries from <a href="http://script.aculo.us/">Script.aculo.us</a> for animation effects and from <a href="http://prototype.conio.net/">Prototype</a> for DOM manipulation and control.<br />
Further and in depht explanation of these two libraries can be found on their respective websites, where you can find wikis and commented examples.</p>
<p>Now, Behaviour requires us to insert the following code, in order to run correctly and apply the rules:<br />
<pre><pre>
&nbsp;&nbsp;&lt;script type=&quot;text/javascript&quot;&gt;
&nbsp;&nbsp; // &lt;![CDATA[
&nbsp;&nbsp;&nbsp;&nbsp; // Behaviour Rules
&nbsp;&nbsp;&nbsp;&nbsp;Behaviour.register(myrules);
&nbsp;&nbsp; // ]]&gt;
&nbsp;&nbsp; &lt;/script&gt;
</pre></pre><br />
I usually add the code at the end of my document, just before closing the <strong>body</strong> tag.<br />
Now, open up a browser window and test.<br />
Please, do yourself a favor: do not use Internet Explorer for testing! Never!</p>
<p>So, is it working?</p>
<p align="center"><img title="Drop Down Screenshot" alt="Drop Down Screenshot" src="http://www.jek2k.com/wp/wp-content/uploads/2006/06/screenshot_drop_down.jpg" /></p>
<p>The result should look like the drop down above (obviously, you have to add you own Css to spice it up and make it look cool!!).</p>
<p>Well, you&#8217;ve seen how a bunch of lines of code can help you create very nice effects, easiliy and in a standard compliant way (you don&#8217;t always need Flash).</p>
<p>Good coding to all of you!!</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
<strong>Updated 16.07.2006:</strong><br />
<a href="http://www.jek2k.com/wp/wp/wp-content/uploads/2006/07/drop_down_js.zip">Download the Source Code</a> (28k ZIP).</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
<strong>Updated 20.12.2006:</strong></p>
<p>Many people asked for multiple drop-downs panels within one page or multiple links to open/close a single drop-down panel.</p>
<p>I made a little variation to the original script to cover both cases.<br />
Hope this helps.<br />
<a href="http://www.jek2k.com/wp/wp-content/uploads/2006/12/multiple_drop_down_js.zip">Download the Source Code</a> (28k ZIP).</p>
<p class="note">This tutorial is provided as is. Please do not email me questions or support requests about the scripts contained in this page. Use the comments below instead. Thank you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jek2k.com/wp/2006/07/14/drop-down-with-javascript/feed/</wfw:commentRss>
		<slash:comments>60</slash:comments>
		</item>
		<item>
		<title>Slideshow JS</title>
		<link>http://www.jek2k.com/wp/2006/07/12/slideshow-js/</link>
		<comments>http://www.jek2k.com/wp/2006/07/12/slideshow-js/#comments</comments>
		<pubDate>Wed, 12 Jul 2006 18:19:53 +0000</pubDate>
		<dc:creator>Nicolò</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.jek2k.com/wp/index.php/2006/07/12/slideshow-js/</guid>
		<description><![CDATA[Link diretto alla risorsa: http://www.jek2k.com/slideshow_js/.
Circa due o tre settimane fa, ho scritto un piccolo script Javascript per realizzare slideshow di immagini, senza ricorrere a Flash.
Le ragioni, e i vantaggi, sono molteplici: dimensioni ridotte, conformità agli standard xhtml e css, funziona senza alcun plugin, facile da modificare al volo, integrabile in siti html esistenti, ecc&#8230;
Dopodichè, me [...]]]></description>
			<content:encoded><![CDATA[<p>Link diretto alla risorsa: <a href="http://www.jek2k.com/slideshow_js/">http://www.jek2k.com/slideshow_js/</a>.</p>
<p>Circa due o tre settimane fa, ho scritto un piccolo script Javascript per realizzare slideshow di immagini, senza ricorrere a Flash.<br />
Le ragioni, e i vantaggi, sono molteplici: dimensioni ridotte, conformità agli standard xhtml e css, funziona senza alcun plugin, facile da modificare al volo, integrabile in siti html esistenti, ecc&#8230;</p>
<p>Dopodichè, me ne sono dimenticato e ho lasciato i files là da qualche parte sul server.</p>
<p>Oggi, spinto dalla richiesta di un cliente, ho rispolverato quello script e, visto che avevo un&#8217;oretta da spendere, l&#8217;ho messo a posto, commentando il codice e ripulendolo un po&#8217;.</p>
<p>Dato che lo trovo abbastanza utile, ho deciso di dargli un nome, di confezionarlo e distribuirlo su Jek2k.com, nella speranza (o illusione) che possa essere utile anche a qualcuno di voi là fuori.</p>
<p>Ho anche pubblicato online <a href="http://www.jek2k.com/slideshow_js/">una demo e una paginetta dedicata</a>, da cui è possibile scaricare i files.<br />
<img src="http://www.jek2k.com/wp/wp-content/uploads/2006/07/slideshow_js_thumb.jpg" alt="Slideshow JS" /></p>
<p>E&#8217; certamente perfezionabile, magari ha anche qualche bug, ma lo scopo è semplicemente condividere una cosa su cui ho speso del tempo, perchè possiate trarne beneficio e da là sviluppare quacosa di vostro. E  magari anche migliore.<br />
Spero che vorrete condividere con me le vostre creazioni&#8230;</p>
<p>ciao</p>
<p class="note">This tutorial is provided as is. Please do not email me questions or support requests about the scripts contained in this page. Use the comments below instead. Thank you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jek2k.com/wp/2006/07/12/slideshow-js/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Hemingway + Lightbox</title>
		<link>http://www.jek2k.com/wp/2006/06/28/hemingway-lightbox/</link>
		<comments>http://www.jek2k.com/wp/2006/06/28/hemingway-lightbox/#comments</comments>
		<pubDate>Wed, 28 Jun 2006 16:34:55 +0000</pubDate>
		<dc:creator>Nicolò</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.jek2k.com/wp/index.php/2006/06/28/hemingway-lightbox/</guid>
		<description><![CDATA[A few days ago I got an email from milo317 from Germany, asking me how  to integrate Lightbox and the Hemingway theme for WordPress, as I did on this website.
That&#8217;s exactly what I&#8217;m going to do in this post. 
For those of you out there who still don&#8217;t know Lightbox, this is a powerful [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago I got an email from milo317 from Germany, asking me how  to integrate Lightbox and the Hemingway theme for WordPress, as I did on this website.<br />
That&#8217;s exactly what I&#8217;m going to do in this post. </p>
<p>For those of you out there who still don&#8217;t know Lightbox, this is a powerful and very functional Javascript utility to display your images. Clean, light-weight, but yet very effective.<br />
  The only fault of Lightbox is that its Css stylesheet doesn&#8217;t validate, because of some proprietary rules for Explorer and Mozilla. However, if you&#8217;re not obsessed about standards or addicted to validation, I believe you will find Lightbox very useful and be using it in many of your projects. <br />
You can get the 2.0 release on <a href="http://www.huddletogether.com/projects/lightbox2/" target="_blank">huddletogether.com</a>.</p>
<p>Hemingway is a quite a popular WordPress theme. This site is also based on the Hemingway theme, obviously spiced up and changed to meet my needs.<br />
  You can download Hemingway from <a href="http://warpspire.com/hemingway" target="_blank">warpspire.com/hemingway</a>.</p>
<p>So, now let&#8217;s see hot to make them work together.<br />
Please note that this tutorial assumes that you have WordPress installed in the <strong>/wordpress/</strong> folder on your server. If you installed it in another directory, keep in mind that you have to change folder and file paths to match your specific configuration.
</p>
<p>First, you need to install the Hemingway theme.<br />
All you need to do is following the instructions included in the package. </p>
<p>Quick recap:<br />
  <strong>1.</strong> unzip the package,<br />
  <strong>2.</strong> upload the <strong>hemingway</strong> folder to your server with an FTP client,<br />
  <strong>3.</strong> put it in the <strong>/wordpress/wp-content/themes/</strong> folder,<br />
<strong>4.</strong> go to your WP admin panel,<br />
<strong>5.</strong> in the <strong>Presentation</strong> section, select and activate the Hemingwat theme,<br />
<strong>6.</strong> go back to your blog, take a look around and congrat yourself: you made it!</p>
<p>If these few instrucions don&#8217;t solve your problem, please don&#8217;t email: I&#8217; m  a WP and Hemingway user just like you. You can get quality support at <a href="http://discuss.warpspire.com/" target="_blank">discuss.warpspire.com</a>.</p>
<p>Next step is getting Lighbox to work with Hemingway.<br />
And this is a little more complicated. </p>
<p>Let&#8217;s go step by step:<br />
  <strong>1.</strong> unzip the package,<br />
  <strong>2.</strong> upload the <strong>js</strong> folder to you server with an FTP client,<br />
  <strong>3.</strong> put it inside your <strong>/wordpress/wp-content/themes/hemingway/</strong> folder,</p>
<p><strong>4.</strong> in the Lightbox package you have an <strong>images</strong> folder.<br />
  Upload the content of this folder to the already existing <strong>/wordpress/wp-content/themes/hemingway/images/</strong> folder.<br />
  This will add the required Lightbox images to the Hemingway standard installation. </p>
<p><strong>5.</strong> Same thing with the <strong>css</strong> folder. <br />
Pick the <strong>lightbox.css</strong> file inside it and upload it to your <strong>/wordpress/wp-content/themes/hemingway/styles/</strong> folder.<br />
Using this folder structure, you don&#8217;t need to change anything in the Lightbox stylesheet.</p>
<p>Unfortunately, you will still need to change a couple of lines in the main <strong>lightbox.js</strong> file. <br />
    <strong>6.</strong> open the <strong>lightbox.js</strong> file with a text editor or with Dreamweaver,<br />
      <strong>7.</strong> at lines 62 and 63 you need to change</p>
<p><pre><pre>var fileLoadingImage = &quot;images/loading.gif&quot;;
var fileBottomNavCloseImage = &quot;images/closelabel.gif&quot;;</pre></pre></p>
<p>to this </p>
<p><pre><pre>var fileLoadingImage = &quot;/wordpress/wp-content/themes/hemingway/images/loading.gif&quot;;
var fileBottomNavCloseImage = &quot;/wordpress/wp-content/themes/hemingway/images/closelabel.gif&quot;;</pre></pre></p>
<p>This will adapt Lightbox to the Hemingway folder structure.</p>
<p>Now we need to integrate Lightbox,<br />
      <strong>8.</strong> in the <strong>/wordpress/wp-content/themes/hemingway/</strong> locate the <strong>header.php</strong> file ,<br />
      <strong>9.</strong> open it in a text editor or in Dreamweaver,<br />
    <strong>10.</strong> in the <strong>head</strong> of the document, add these lines:</p>
<p><pre><pre>&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;?php bloginfo(&#039;stylesheet_directory&#039;); ?&gt;/js/prototype.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;?php bloginfo(&#039;stylesheet_directory&#039;); ?&gt;/js/scriptaculous.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;&lt;?php bloginfo(&#039;stylesheet_directory&#039;); ?&gt;/js/lightbox.js&quot;&gt;&lt;/script&gt;</pre></pre><br />
This will include the required JS scripts in every WordPress generated page.</p>
<p><strong>11.</strong> always in the <strong>head</strong> of the <strong>header.php</strong> file add this line:<br />
<pre><pre>
&lt;link rel=&quot;stylesheet&quot; href=&quot;&lt;?php bloginfo(&#039;stylesheet_directory&#039;); ?&gt;/styles/lightbox.css&quot; type=&quot;text/css&quot; media=&quot;screen&quot; /&gt; 
</pre></pre><br />
This will add the required Css stylesheet for Lightbox in your WordPress content.</p>
<p>Now, let&#8217;s try it!<br />
<strong>12.</strong> open your WP admin panel and write a new post,<br />
<strong>13.</strong> insert a link to an uploaded image, using this sintax:<br />
<pre><pre>
&lt;a href=&quot;images/image-1.jpg&quot; rel=&quot;lightbox&quot; title=&quot;my caption&quot;&gt;image #1&lt;/a&gt;
</pre></pre></p>
<p>Obviously you need to change this line of code to match your image path.</p>
<p><strong>14.</strong> Go to the newly posted artcicle and test the link. Is it working?<br />
If yes, then you made it!<br />
If it&#8217;s not working, either you messed up something or my tutorial is wrong.<br />
Remember to run the test with a modern browser, don&#8217;t even try to do it with IE or older browsers!</p>
<p>Please refer to <a href="http://www.huddletogether.com/projects/lightbox2/#support" target="_blank">this site</a> to get Lightbox-specific help.<br />
For Hemingway and Lightbox integration issues, you can comment this post, email me or simply analyze and copy the source code of my WordPress pages!</p>
<p>Hope you will find this helpful. Bye. </p>
<p class="note">This tutorial is provided as is. Please do not email me questions or support requests about the scripts contained in this page. Use the comments below instead. Thank you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jek2k.com/wp/2006/06/28/hemingway-lightbox/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Drop down con Javascript</title>
		<link>http://www.jek2k.com/wp/2006/06/10/drop-down-con-javascript/</link>
		<comments>http://www.jek2k.com/wp/2006/06/10/drop-down-con-javascript/#comments</comments>
		<pubDate>Fri, 09 Jun 2006 22:17:33 +0000</pubDate>
		<dc:creator>Nicolò</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.jek2k.com/wp/index.php/2006/06/10/drop-down-con-javascript/</guid>
		<description><![CDATA[Come ho realizzato il menù a discesa animato qui sopra?
Ok, magari per molti di voi è una banalità, ma sono sicuro che a qualcuno invece interesserà saperlo. Per queste (poche) persone, ecco un breve tutorial.
Innanzitutto ho sfruttato esclusivamente gli standard, mantenendo il mio codice Xhtml pulito e valido, così come il mio Css.
L&#8217;interazione è stata [...]]]></description>
			<content:encoded><![CDATA[<p>Come ho realizzato il menù a discesa animato qui sopra?<br />
Ok, magari per molti di voi è una banalità, ma sono sicuro che a qualcuno invece interesserà saperlo. Per queste (poche) persone, ecco un breve tutorial.</p>
<p>Innanzitutto ho sfruttato <em>esclusivamente gli standard</em>, mantenendo il mio codice Xhtml pulito e valido, così come il mio Css.<br />
L&#8217;interazione è stata realizzata sfruttando alcune (ormai molto note) librerie Javascript gratuite e distribuite sotto licenze di tipo GPL.<br />
In particolare, vi serviranno le librerie di:</p>
<ul>
<li><a href="http://prototype.conio.net/">Prototype</a></li>
<li><a href="http://script.aculo.us/">Script.aculo.us</a></li>
<li><a href="http://bennolan.com/behaviour/">Behaviour</a></li>
</ul>
<p>che potete tranquillamente scaricare dai rispettivi siti web.<br />
<span id="more-7"></span><br />
Prima di tutto, ora che abbiamo le librerie, includiamole nel nostro documento Html, così:<br />
<pre><pre>&lt;script src=&quot;/js/prototype.js&quot; type=&quot;text/javascript&quot;&gt;&lt;!--mce:0--&gt;&lt;/script&gt;
&lt;script src=&quot;/js/scriptaculous.js&quot; type=&quot;text/javascript&quot;&gt;&lt;!--mce:1--&gt;&lt;/script&gt;
&lt;script src=&quot;/js/behaviour.js&quot; type=&quot;text/javascript&quot;&gt;&lt;!--mce:2--&gt;&lt;/script&gt;
</pre></pre><br />
Ovviamente adattate i percorsi dei file in base alla struttura del vostro sito.Dopodichè, dobbiamo creare i due elementi coinvolti nell&#8217;interazione, rispettivamente il link che attiva/disattiva l&#8217;animazione e il Div con i contenuti a scomparsa.</p>
<p>Partiamo dal link:<br />
<pre><pre>&lt;a id=&quot;open&quot; href=&quot;javascript:void(0);&quot;&gt;Open&lt;/a&gt;
&lt;a id=&quot;close&quot; style=&quot;display:none;&quot; href=&quot;javascript:void(0);&quot;&gt;Close&lt;/a&gt;
</pre></pre><br />
E&#8217; importante impostare gli ID degli elementi, ci verrano utili tra poco.<br />
Poi creiamo un Div con i contenuti: Lo chiamiamo <strong>contents</strong>:<br />
<pre><pre>
&lt;div id=&quot;contents&quot; style=&quot;display:none;&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp; bla bla bla bla bla bla&lt;/div&gt;

</pre></pre><br />
Ora, normalemente, per associare un comportamento Javascript ad un link si userebbe l&#8217;attributo <strong>onclick</strong> del tag <strong>a</strong>.<br />
Tuttavia si tratta di un attributo &#8220;sporco&#8221;, che esula dalle iniziale specifiche html e xhtml, ed è stato introdotto al solo scopo di supportare le funzionalità JS citate, imponendosi come standard de facto.<br />
Giustamente, la specifica Xhtml Strict non lo prevede. Quindi noi non lo useremo.</p>
<p>Qui ci viene in aiuto <a href="http://bennolan.com/behaviour/">Behaviour</a>, che ci dà la possibilità di abbinare dei comportamenti (appunto) agli elementi Html utilizzando i selettori Css, attraverso la definizione di regole (rules).In questo caso le nostre regole saranno:<br />
<pre><pre>// Rules
var myrules = {
&nbsp;&nbsp;&#039;#open&#039; : function(element){
&nbsp;&nbsp;&nbsp;&nbsp;element.onclick = function(){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var targetDiv = $(&#039;contents&#039;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new Effect.BlindDown(targetDiv,{duration: 0.5});
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;},
&nbsp;&nbsp;&#039;#close : function(element){
&nbsp;&nbsp;&nbsp;&nbsp;element.onclick = function(){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var targetDiv = $(&#039;contents&#039;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;new Effect.BlindUp(targetDiv,{duration: 0.5});
&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;}
};
</pre></pre><br />
Salviamo questo JS in un file rules.js e includiamolo nel nostro documento Html.<br />
<pre><pre>&lt;script src=&quot;/js/rules.js&quot; type=&quot;text/javascript&quot;&gt;&lt;!--mce:3--&gt;&lt;/script&gt;
</pre></pre><br />
Il codice sfrutta le librerie di <a href="http://script.aculo.us/">Script.aculo.us</a> per gli effetti animati e quella di <a href="http://prototype.conio.net/">Prototype</a> per la manipolazione e l&#8217;identificazione degli elementi Html.<br />
Delego spiegazioni più approfondite circa il funzionamento di tali librerie ad un altro post, o ai siti dei singoli script.</p>
<p>Ora, Behaviour richiede che venga inserito il seguente codice, affinchè le regole scritte in precedenza vengano applicate:<br />
<pre><pre>&nbsp;&nbsp;&lt;script type=&quot;text/javascript&quot;&gt;&lt;!--mce:4--&gt;&lt;/script&gt;
</pre></pre><br />
Il mio consiglio è di inserire questo JS alla fine della pagina, subito prima della chiusura del tag <strong>body</strong>.<br />
A questo punto aprite un browser e testate.<br />
Per fare un favore a me e a voi stessi, non usate Internet Explorer per questo genere di cose. Mai.<br />
Funziona?</p>
<p align="center"><img title="Drop Down Screenshot" src="http://www.jek2k.com/wp/wp-content/uploads/2006/06/screenshot_drop_down.jpg" alt="Drop Down Screenshot" /></p>
<p>Il risultato dovrebbe essere simile al drop down che vedete su questo sito (ovviamente dopo dovrete metterci del vostro e aggiungere un po&#8217; di Css!!).</p>
<p>Beh, è evidente che con queste poche righe di codice potete realizzare effetti molto gradevoli e dare un po&#8217; di pepe alle vostre pagine Html (Flash non è sempre l&#8217;unica soluzione&#8230;).</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
<strong>Updated 16.06.2006:</strong><br />
<a href="http://www.jek2k.com/wp/wp/wp-content/uploads/2006/07/drop_down_js.zip">Scarica il sorgente</a> (28k ZIP).</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
<strong>Updated 20.12.2006:</strong></p>
<p>In molti avete chiesto come fare per inserire più drop-down nella stessa pagina o come fare per avere più link che &#8220;comandano&#8221; lo stesso drop-down.</p>
<p>Ho fatto una variante dello script originale per coprire entrambe le esigenze.<br />
Spero che vi sia di aiuto.</p>
<p><a href="http://www.jek2k.com/wp/wp-content/uploads/2006/12/multiple_drop_down_js.zip">Scarica il sorgente</a> (28k ZIP).</p>
<p class="note">This tutorial is provided as is. Please do not email me questions or support requests about the scripts contained in this page. Use the comments below instead. Thank you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jek2k.com/wp/2006/06/10/drop-down-con-javascript/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
	</channel>
</rss>

