<?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>CB1, INC. &#187; lightboxnano</title>
	<atom:link href="http://www.cb1inc.com/category/lightboxnano/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cb1inc.com</link>
	<description></description>
	<lastBuildDate>Wed, 28 Sep 2011 17:54:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Introducing the LightboxNano for Dojo!</title>
		<link>http://www.cb1inc.com/2008/10/14/introducing-the-lightboxnano-for-dojo/</link>
		<comments>http://www.cb1inc.com/2008/10/14/introducing-the-lightboxnano-for-dojo/#comments</comments>
		<pubDate>Tue, 14 Oct 2008 20:36:34 +0000</pubDate>
		<dc:creator>Chris Barber</dc:creator>
				<category><![CDATA[dojo]]></category>
		<category><![CDATA[lightboxnano]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[<p>I saw a really neat lightweight lightbox a while ago and decided to make a version for Dojo.  I've dubbed this version the LightboxNano because it is under 2K over the wire after a build and being gzip'd.</p>

<p>The LightboxNano is <em>not</em> a <code>dijit._Widget</code>.  It is designed to be very lightweight and only requires Dojo core and <code>dojo.fx</code>. The LightboxNano was coded for Dojo 1.2, but should work with past versions with little or no modifications.</p>

<h3>Features</h3>

<p>For being so small, it packs a handful of features:</p>

<ul>
<li>Automatically resizes large images to fit in browser window.</li>
<li>Preloads the larger image to make loading faster.</li>
<li>Keyboard accessible.</li>
<li>Instantly makes your website awesome.</li>
</ul>

<h3>Example</h3>

<p>The LightboxNano is really easy to use.  Here's an example:</p>

<pre><code>&#60;script src="/path/to/dojo.js" type="text/javascript"&#62;&#60;/script&#62;
&#60;script type="text/javascript"&#62;
    dojo.require("dojo.parser");
    dojo.require("dojox.image.LightboxNano");
&#60;/script&#62;

&#60;a dojoType="dojox.image.LightboxNano" href="/path/to/large/image.jpg"&#62;
    &#60;img src="/path/to/small/image.jpg"&#62;
&#60;/a&#62;</code></pre>

<p>To see it in action, click the image below:</p>

<?
$url = 'http://farm4.static.flickr.com/3270/2881707822_46f76966e4.jpg';
if(strtolower(arg(0)) == 'rss.xml'){
    $url = 'http://www.cb1inc.com/2008/10/14/introducing-the-lightboxnano-for-dojo';
}
?>

<div align="center"><a dojoType="dojox.image.LightboxNano" 
href="<?= $url ?>" id="exampleLightboxNano" style="width:240px;height:180px;"><img src="http://farm4.static.flickr.com/3270/2881707822_46f76966e4_m.jpg" width="240" height="180"></a></div>

<h3>Styling</h3>

<p>When the LightboxNano is created, it adds two <code>&#60;div&#62;</code> tags inside the anchor tag: one for the enlarge icon and one for the loading icon. For example, you can define styles like this:</p>

<pre><code>a:hover .dojoxEnlarge {
    display: block !important;
}
.dojoxEnlarge {
    background: url(images/enlarge.png) no-repeat 0 0;
    top: -5px;
    left: -5px;
    margin: 0 !important;
    width: 16px;
    height: 16px;
}
.dojoxLoading {
    background: #333 url(images/loading-dark.gif) no-repeat center center;
    border-radius: 5px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border: 2px solid #000;
    height: 24px;
    opacity: 0.8;
    filter: alpha(opacity=80);
    padding: 6px;
    width: 24px;
}</code></pre>

<h3>Usage</h3>

<p>You can declaratively create the LightboxNano using a dojoType on an <code>&#60;a&#62;</code> or <code>&#60;img&#62;</code> tag.  Or you can choose to programatically create the LightboxNano:</p>

<pre><code>&#60;script type="text/javascript"&#62;
    dojo.addOnLoad(function(){
        new LightboxNano({
            href: "/path/to/large/image.jpg"
        }, "myLink");
    });
&#60;/script&#62;

&#60;a id="myLink" href="/path/to/large/image.jpg"&#62;
    &#60;img src="/path/to/small/image.jpg"&#62;
&#60;/a&#62;</code></pre>

<p>If you want to access it for some reason, you'll need to use its <code><a href="http://dojocampus.org/content/2008/05/06/jsid-dijitbyid-and-dojobyid/">jsId</a></code>.</p>

<h3>Parameters</h3>

<p><b>href</b> - String<br />
URL to the large image to show in the lightbox.</p>

<p><b>duration</b> - int<br />
The delay in milliseconds of the LighboxNano open and close animation.</p>

<p><b>preloadDelay</b> - int<br />
The delay in milliseconds after the LightboxNano is created before preloading the larger image.</p>

<h3>File Sizes</h3>

<p>The LightboxNano is pretty small, but it relies on several other core Dojo components.  If you do a custom Dojo build containing the LightboxNano and <code>dojo.parser</code>, the <code>dojo.js</code> is 96KB. If you enable HTTP compression on the web server, you can get that down to a nice 32KB.</p>

<h3>Limitations</h3>

<ul>
<li>The LightboxNano does not reposition itself when the browser window is resize or scrolled.</li>
<li>In IE6, drop down select lists bleed through the LighboxNano layer. This can be fixed with an iframe shim.  This was skipped to keep the size down and because we all want IE6 to just go away.</li>
</ul>

<h3>Future Improvements</h3>

<p>There's always things that can be done to improve the LightboxNano.  Here's a couple ideas and you're welcome to make suggestions in the comments.</p>

<ul>
<li>Add support for displaying a caption.</li>
<li>Add support for <code>dojox.embed</code> to play Flash or Quicktime movies.</li>
</ul>

<h3>Try it Today!</h3>

<p>You can download the LightboxNano files here: <a href="http://www.cb1inc.com/files/LightboxNano.tar.gz">LightboxNano.tar.gz</a> [594KB].  Soon, the LightboxNano will be in dojox, so you won't need to install it separately.</p>

<p>You can view the original test page here: <a href="http://www.cb1inc.com/dojo-1.2/dojox/image/tests/test_LightboxNano.html">http://www.cb1inc.com/dojo-1.2/dojox/image/tests/test_LightboxNano.html</a>.</p>

<p>If you end up using the LightboxNano, feel free to link to your site so everyone can see your new awesome website!</p>
]]></description>
			<content:encoded><![CDATA[<p>I saw a really neat lightweight lightbox a while ago and decided to make a version for Dojo.  I&#8217;ve dubbed this version the LightboxNano because it is under 2K over the wire after a build and being gzip&#8217;d.</p>
<p>The LightboxNano is <em>not</em> a <code>dijit._Widget</code>.  It is designed to be very lightweight and only requires Dojo core and <code>dojo.fx</code>. The LightboxNano was coded for Dojo 1.2, but should work with past versions with little or no modifications.</p>
<h3>Features</h3>
<p>For being so small, it packs a handful of features:</p>
<ul>
<li>Automatically resizes large images to fit in browser window.</li>
<li>Preloads the larger image to make loading faster.</li>
<li>Keyboard accessible.</li>
<li>Instantly makes your website awesome.</li>
</ul>
<h3>Example</h3>
<p>The LightboxNano is really easy to use.  Here&#8217;s an example:</p>
<pre class="brush: jscript; title: ;">
&lt;script src=&quot;/path/to/dojo.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
    dojo.require(&quot;dojo.parser&quot;);
    dojo.require(&quot;dojox.image.LightboxNano&quot;);
&lt;/script&gt;

&lt;a dojoType=&quot;dojox.image.LightboxNano&quot; href=&quot;/path/to/large/image.jpg&quot;&gt;
    &lt;img src=&quot;/path/to/small/image.jpg&quot;&gt;
&lt;/a&gt;
</pre>
<p>To see it in action, click the image below:</p>
<p><script type="text/javascript">
dojo.addOnLoad(function(){
  var n=dojo.byId("exampleLightboxNano");
  new dojox.image.LightboxNano({href:"http://farm4.static.flickr.com/3270/2881707822_46f76966e4.jpg"}, n);
});
</script></p>
<div align="center"><a href="/2008/10/14/introducing-the-lightboxnano-for-dojo" id="exampleLightboxNano" style="width:240px;height:180px;"><img src="http://farm4.static.flickr.com/3270/2881707822_46f76966e4_m.jpg" width="240" height="180"></a></div>
<h3>Styling</h3>
<p>When the LightboxNano is created, it adds two <code>&lt;div&gt;</code> tags inside the anchor tag: one for the enlarge icon and one for the loading icon. For example, you can define styles like this:</p>
<pre class="brush: css; title: ;">
a:hover .dojoxEnlarge {
    display: block !important;
}
.dojoxEnlarge {
    background: url(images/enlarge.png) no-repeat 0 0;
    top: -5px;
    left: -5px;
    margin: 0 !important;
    width: 16px;
    height: 16px;
}
.dojoxLoading {
    background: #333 url(images/loading-dark.gif) no-repeat center center;
    border-radius: 5px;
    -moz-border-radius: 5px;
    -webkit-border-radius: 5px;
    border: 2px solid #000;
    height: 24px;
    opacity: 0.8;
    filter: alpha(opacity=80);
    padding: 6px;
    width: 24px;
}
</pre>
<h3>Usage</h3>
<p>You can declaratively create the LightboxNano using a dojoType on an <code>&lt;a&gt;</code> or <code>&lt;img&gt;</code> tag.  Or you can choose to programatically create the LightboxNano:</p>
<pre class="brush: jscript; title: ;">
&lt;script type=&quot;text/javascript&quot;&gt;
    dojo.addOnLoad(function(){
        new LightboxNano({
            href: &quot;/path/to/large/image.jpg&quot;
        }, &quot;myLink&quot;);
    });
&lt;/script&gt;

&lt;a id=&quot;myLink&quot; href=&quot;/path/to/large/image.jpg&quot;&gt;
    &lt;img src=&quot;/path/to/small/image.jpg&quot;&gt;
&lt;/a&gt;
</pre>
<p>If you want to access it for some reason, you&#8217;ll need to use its <code><a href="http://dojocampus.org/content/2008/05/06/jsid-dijitbyid-and-dojobyid/">jsId</a></code>.</p>
<h3>Parameters</h3>
<p><b>href</b> &#8211; String<br />
URL to the large image to show in the lightbox.</p>
<p><b>duration</b> &#8211; int<br />
The delay in milliseconds of the LighboxNano open and close animation.</p>
<p><b>preloadDelay</b> &#8211; int<br />
The delay in milliseconds after the LightboxNano is created before preloading the larger image.</p>
<h3>File Sizes</h3>
<p>The LightboxNano is pretty small, but it relies on several other core Dojo components.  If you do a custom Dojo build containing the LightboxNano and <code>dojo.parser</code>, the <code>dojo.js</code> is 96KB. If you enable HTTP compression on the web server, you can get that down to a nice 32KB.</p>
<h3>Limitations</h3>
<ul>
<li>The LightboxNano does not reposition itself when the browser window is resize or scrolled.</li>
<li>In IE6, drop down select lists bleed through the LighboxNano layer. This can be fixed with an iframe shim.  This was skipped to keep the size down and because we all want IE6 to just go away.</li>
</ul>
<h3>Future Improvements</h3>
<p>There&#8217;s always things that can be done to improve the LightboxNano.  Here&#8217;s a couple ideas and you&#8217;re welcome to make suggestions in the comments.</p>
<ul>
<li>Add support for displaying a caption.</li>
<li>Add support for <code>dojox.embed</code> to play Flash or Quicktime movies.</li>
</ul>
<h3>Try it Today!</h3>
<p>You can download the LightboxNano files here: <a href="/files/LightboxNano.tar.gz">LightboxNano.tar.gz</a> [594KB].  Soon, the LightboxNano will be in dojox, so you won&#8217;t need to install it separately.</p>
<p>You can view the original test page here: <a href="http://download.dojotoolkit.org/release-1.3.1/dojo-release-1.3.1/dojox/image/tests/test_LightboxNano.html">http://download.dojotoolkit.org/release-1.3.1/dojo-release-1.3.1/dojox/image/tests/test_LightboxNano.html</a>.</p>
<p>If you end up using the LightboxNano, feel free to link to your site so everyone can see your new awesome website!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cb1inc.com/2008/10/14/introducing-the-lightboxnano-for-dojo/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

