<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>nooxnet.com</title>
	
	<link>http://nooxnet.com</link>
	<description>Forums &amp; Web</description>
	<lastBuildDate>Sun, 12 Jul 2009 15:55:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Nooxnetcom" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="nooxnetcom" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Lightbox 2 with Auto-Resize in Wordpress</title>
		<link>http://nooxnet.com/2009-07-12/lightbox-2-with-auto-resize-in-wordpress/</link>
		<comments>http://nooxnet.com/2009-07-12/lightbox-2-with-auto-resize-in-wordpress/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 13:49:23 +0000</pubDate>
		<dc:creator>noox</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Auto-Resize]]></category>
		<category><![CDATA[Images]]></category>
		<category><![CDATA[Lightbox]]></category>
		<category><![CDATA[Photos]]></category>
		<category><![CDATA[Pictures]]></category>

		<guid isPermaLink="false">http://nooxnet.com/?p=27</guid>
		<description><![CDATA[[German version available: Lightbox 2 mit Auto-Resize in Wordpress]
I&#8217;ve integrated Lightbox 2 on my blogs but noted one problem: The wordpress plugins for Lightbox 2 do not support auto-resizing. I&#8217;ve put together some scripts which each solve parts of the problem. So I got Lightbox 2 in Wordpress with auto-resize.
There are different versions of Lightbox. [...]]]></description>
			<content:encoded><![CDATA[<p>[German version available: <a href="http://noox.at/2009-05-28/lightbox-2-mit-auto-resize-in-wordpress/" target="_blank">Lightbox 2 mit Auto-Resize in Wordpress</a>]</p>
<p>I&#8217;ve integrated Lightbox 2 on my blogs but noted one problem: The wordpress plugins for Lightbox 2 do not support auto-resizing. I&#8217;ve put together some scripts which each solve parts of the problem. So I got Lightbox 2 in Wordpress with auto-resize.</p>
<p>There are different versions of Lightbox. Some under different names. Their main functionality is: When you click on a thumbnail of an image the screen is darkened and the image is displayed in a bigger size. Often with a broad white border. Usually you are able to navigate between the different images on a page.</p>
<p>The problem is that usually the big image is displayed with a fixed size. So the images should have sizes that  fit also smaller monitors. Unless Lightbox would allow automatic resizing dependent on the screen size. Unfortunately there are not many scripts which support this feature. At least, I  have not found any for wordpress.</p>
<p>Here you can see how it could work:</p>
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td><a title="Biene bei der Arbeit am Apfelbaum" href="http://noox.at/wp-content/uploads/2009/05/biene-apfelblute.jpg"><img class="size-thumbnail wp-image-180 alignnone" title="Biene bei der Arbeit am Apfelbaum" src="http://noox.at/wp-content/uploads/2009/05/biene-apfelblute-150x150.jpg" alt="Biene bei der Arbeit am Apfelbaum" width="150" height="150" /></a></td>
<td style="width: 10px;"></td>
<td><a title="Katze" href="http://noox.at/wp-content/uploads/2009/05/katze.jpg"><img class="size-thumbnail wp-image-181 alignnone" title="Katze" src="http://noox.at/wp-content/uploads/2009/05/katze-150x150.jpg" alt="Katze" width="150" height="150" /></a></td>
<td style="width: 10px;"></td>
<td><a title="Wallride Mountain Bike Park Whistler" href="http://noox.at/wp-content/uploads/2009/05/whistler-wallride-1600.jpg"><img class="size-thumbnail wp-image-190 alignnone" title="Wallride Mountain Bike Park Whistler" src="http://noox.at/wp-content/uploads/2009/05/whistler-wallride-1600-150x150.jpg" alt="Wallride Mountain Bike Park Whistler" width="150" height="150" /></a></td>
</tr>
</tbody>
</table>
<h2>Wordpress Lightbox 2 Plugin</h2>
<p><a href="http://www.huddletogether.com/projects/lightbox2/" target="_blank">Lightbox 2</a> is a script written by  <a href="http://www.lokeshdhakar.com/" target="_blank">Lokesh Dhakar</a> which can be added to existing web pages to provide the Lightbox functionality to the images on the page. The script works independently from wordpress.</p>
<p>In the Wordpress plugin directory I found two Lightbox 2 plugins. I first tried the plugin Lightbox 2 version 2.8.2 written by  Ruppert Morris as it had the better rating.</p>
<p>When I was looking for auto-resizing functionality for Lightbox 2 I found the blog post &#8220;<a href="http://blog.hma-info.de/2008/04/09/latest-lightbox-v2-with-automatic-resizing/" target="_blank">Latest Lightbox V2 with automatic resizing</a>&#8221; written by Fabian Lange. He added auto-resizing to Lightbox V2.04 without changing much of the original code.</p>
<p>When I looked into the Lightbox 2 plugin of Ruppert Morris I saw that he had extensively changed the original Lightbox 2 code. So I tried the second Lightbox 2 plugin.</p>
<p>This is the <a href="http://wordpress.org/extend/plugins/lightbox-2-wordpress-plugin/" target="_blank">Lightbox 2 Plugin, Version 2.0.2</a> provided by  <a href="http://www.4mj.it/" target="_blank">Giuseppe Argento</a>. It is built on the original Lightbox 2.0.4 with just some minimal changes. I did a three way comparison of this plugin, the original Lightbox 2 code and the code with the auto-resize functionality from Fabian Lange. So I could integrate the auto resizing functionality in the wordpress plugin.</p>
<p>I integrated the following features added by  Fabian Lange (<a href="http://blog.hma-info.de/2008/04/09/latest-lightbox-v2-with-automatic-resizing/" target="_blank">see Blog</a>):</p>
<ul>
<li>Auto-Resize</li>
<li>Opera 9 Bugfix</li>
<li>Bugfix: If the next image has no caption/description.</li>
</ul>
<p>Further more I added these features:</p>
<ul>
<li>The Lightbox 2 script uses a fixed top margin. I&#8217;m now calculating the top margin such that it should be vertically centered. The size of the bottom border with the image description is included in the picture height (fixed value changeable in the head of the script) .</li>
<li>As I had problems with the dark transparent background I changed it to &#8220;position:fixed;&#8221;. One problem exists: When the window size is increased the dark background only appears with some delay.</li>
<li>In the resize code an event handler tracks the resize of the browser window. I had the problem that this handler was not removed when the lightbox was closed. So the image appeared again when the browser window has been resized. I changed the code that the  event handler is removed when the lightbox is closed.</li>
</ul>
<p>One minor cosmetic problem still exists: As the images are also adjusted vertically they do not move to their top position slowly animated but jerky.</p>
<h2>Installation of Lightbox 2 with Auto-Resizing in Wordpress</h2>
<ol>
<li>Download and install the Wordpress plugin written by Giuseppe Argento: <a href="http://wordpress.org/extend/plugins/lightbox-2-wordpress-plugin/" target="_blank">Lightbox 2 v2.0.2</a>.</li>
<li>Download <a href="http://www.noox.at/download/lightbox.css" target="_blank">lightbox.css</a>. Copy to (replace file)  wp-content\plugins\lightbox-2-wordpress-plugin\lightbox\css\ .</li>
<li>Download <a href="http://www.noox.at/download/lightbox.js" target="_blank">lightbox.js</a>. Copy to (replace file) wp-content\plugins\lightbox-2-wordpress-plugin\lightbox\js\.</li>
</ol>
<h2>Credits</h2>
<ul>
<li><a href="http://www.lokeshdhakar.com/" target="_blank">Lokesh Dhakar</a> for Lightbox 2.</li>
<li><a href="http://www.4mj.it/" target="_blank">Giuseppe Argento</a> for the  Wordpress-Plugin.</li>
<li> <a href="http://blog.hma-info.de/" target="_blank">Fabian Lange</a> for the auto-resizing functionality.</li>
</ul>
<h2>Some more Tips</h2>
<ul>
<li>Enable &#8220;Auto-Lightbox&#8221; in the settings of the Lightbox 2 Plugin.</li>
<li>When adding a new image to a post the field &#8220;Link URL&#8221; must be filled with the URL to the image. If this is not filled, use the buttons &#8220;File URL&#8221; (when adding a new image) or &#8220;Link to Image&#8221; (when editing) to add the URL.</li>
<li>Vince has posted on the <a href="http://noox.at/2009-05-28/lightbox-2-mit-auto-resize-in-wordpress/" target="_blank">German version of this post</a> that the Lightbox 2 plugin does not automatically work with old posts. You can find a fix here: <a onclick="javascript:pageTracker._trackPageview('/wordpress.org');" href="http://wordpress.org/support/topic/227077">http://wordpress.org/support/topic/227077</a></li>
<li>The auto resizing Lightbox worked for me in the following Wordpress versions: 2.7.x, 2.8, 2.8.1.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://nooxnet.com/2009-07-12/lightbox-2-with-auto-resize-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
	</channel>
</rss>

