<?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>Klaus Hartl - Stilbüro &#187; jQuery</title>
	<atom:link href="http://www.stilbuero.de/category/web-development/javascript/jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.stilbuero.de</link>
	<description>We are reasonable people.</description>
	<lastBuildDate>Sat, 01 Nov 2008 19:08:11 +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>jQuery Delegate plugin &#8211; cross-browser submit/reset event delegation</title>
		<link>http://www.stilbuero.de/2008/04/27/jquery-delegate-plugin-cross-browser-submitreset-event-delegation/</link>
		<comments>http://www.stilbuero.de/2008/04/27/jquery-delegate-plugin-cross-browser-submitreset-event-delegation/#comments</comments>
		<pubDate>Sun, 27 Apr 2008 19:33:37 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.stilbuero.de/2008/04/27/jquery-delegate-plugin-cross-browser-submitreset-event-delegation/</guid>
		<description><![CDATA[Dan Webb has written an event delegation plugin the other day (as part of Low Pro for jQuery) &#8211; I really like his solution and as soon as you are working with Ajax page updates a lot you got to love the ease the event delegation technique provides.
There is one major drawback though. In IE [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.danwebb.net/2008/2/8/event-delegation-made-easy-in-jquery">Dan Webb has written an event delegation plugin</a> the other day (as part of Low Pro for jQuery) &#8211; I really like his solution and as soon as you are working with Ajax page updates a lot you got to love the ease the event delegation technique provides.</p>
<p>There is one major drawback though. In <abbr title="Internet Explorer">IE</abbr> submit and reset events do not bubble, thus you cannot use delegation here. Same is true for submit events in Safari 2.</p>
<p>In the upcoming <a href="htp://plazes.com">Plazes</a> delegation for submit/reset events turned out to be a requirement, so I wrote an event delegation plugin based on Dan Webb&#8217;s stuff, in particular on what Yehuda Katz proposed in one of the comments, and added workarounds for IE and Safari, so that you can now use delegation for these events just as you would expect. There were also some issues with using <code>confirm()</code>.</p>
<p>I needed to do that quickly, thus the code could use some optimization (later). </p>
<p>Get it here:<br />
<a href="http://stilbuero.de/jquery/delegate/">http://stilbuero.de/jquery/delegate/</a></p>
<p>I just noticed that Jörn Zaefferer wrote <a href="http://dev.jquery.com/view/trunk/plugins/delegate/jquery.delegate.js">something similar for the focus and blur events</a> and I&#8217;m going to merge the two. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.stilbuero.de/2008/04/27/jquery-delegate-plugin-cross-browser-submitreset-event-delegation/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>jQuery UI Tabs aka Tabs 3</title>
		<link>http://www.stilbuero.de/2007/10/23/jquery-ui-tabs-aka-tabs-3/</link>
		<comments>http://www.stilbuero.de/2007/10/23/jquery-ui-tabs-aka-tabs-3/#comments</comments>
		<pubDate>Tue, 23 Oct 2007 11:46:41 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.stilbuero.de/2007/10/23/jquery-ui-tabs-aka-tabs-3/</guid>
		<description><![CDATA[Being a part of the jQuery UI project, UI Tabs aka Tabs 3 has been released the other day.
Until today I have fixed a bunch of bugs that popped up and I hope Tabs 3 is stable now. I&#8217;ve added a couple of frequently requested features but please be aware that the new Tabs require [...]]]></description>
			<content:encoded><![CDATA[<p>Being a part of the <a href="http://ui.jquery.com/">jQuery UI project</a>, UI Tabs aka Tabs 3 has been <a href="http://jquery.com/blog/2007/09/17/jquery-ui-interactions-and-widgets/">released the other day</a>.</p>
<p>Until today I have fixed a bunch of bugs that popped up and I hope Tabs 3 is stable now. I&#8217;ve added a couple of frequently requested features but please be aware that the new Tabs require jQuery 1.2.1 and also that I have left away history support for now. The history plugin itself needs a major overhaul and when that is done I will build it into Tabs again. I have closed down comments on all of the Tabs 2 posts to indicate that this version will not be maintained any longer.</p>
<p>If you&#8217;d like to report a bug, I&#8217;d like to ask to you to <a href="http://dev.jquery.com/newticket">file a ticket</a>. This way it&#8217;s much easier to keep track of bugs and if you post a bug in the comments I will create a ticket anyway.</p>
<p>To be consistent with other UI modules, i.e. to conform to some conventions we set up, <strong>the Tabs API has changed</strong> quite a bit. The <a href="http://docs.jquery.com/UI/Tabs">documentation</a>, which has been moved from the source file to the <a href="http://docs.jquery.com/Main_Page">jQuery documentation Wiki</a> is your friend (and because it&#8217;s a Wiki everybody can help to improve it &#8211; remember I&#8217;m not a native english speaker and documenting code is not always easy for me). I&#8217;ll also write a follow-up post about the most important changes and additions.</p>
<p><a href="/jquery/tabs_3/">A demo is here.</a></p>
<p>Thank you for using Tabs!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stilbuero.de/2007/10/23/jquery-ui-tabs-aka-tabs-3/feed/</wfw:commentRss>
		<slash:comments>276</slash:comments>
		</item>
		<item>
		<title>Tabs Plugin: More flexibility</title>
		<link>http://www.stilbuero.de/2007/05/14/tabs-plugin-more-flexibility/</link>
		<comments>http://www.stilbuero.de/2007/05/14/tabs-plugin-more-flexibility/#comments</comments>
		<pubDate>Mon, 14 May 2007 09:34:33 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.stilbuero.de/2007/05/14/tabs-plugin-more-flexibility/</guid>
		<description><![CDATA[Just a short note, I&#8217;ve updated the CSS for the Tabs plugin &#8211; because people did not stop asking &#8211; and tabs have a flexible width and height again. They still maintain a minimal width as well, so that tabs with short titles, as in the demo, will have the same width. Otherwise it would [...]]]></description>
			<content:encoded><![CDATA[<p>Just a short note, I&#8217;ve updated the CSS for the <a href="/jquery/tabs/#fragment-3">Tabs plugin</a> &#8211; because people did not stop asking &#8211; and tabs have a flexible width and height again. They still maintain a minimal width as well, so that tabs with short titles, as in the demo, will have the same width. Otherwise it would look a little cluttered (well, at least to me). I&#8217;m using a <a href="http://alistapart.com/articles/sprites">sprite technique</a> for the different parts of the tab of course, thus only one image needs to be downloaded.</p>
<p>Important to know is that this required <strong>an additional <code>span</code> element</strong> nested in the anchor element of a tab.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stilbuero.de/2007/05/14/tabs-plugin-more-flexibility/feed/</wfw:commentRss>
		<slash:comments>81</slash:comments>
		</item>
		<item>
		<title>Tabs 2.7: Flexibility</title>
		<link>http://www.stilbuero.de/2007/04/07/tabs-27-flexibility/</link>
		<comments>http://www.stilbuero.de/2007/04/07/tabs-27-flexibility/#comments</comments>
		<pubDate>Sat, 07 Apr 2007 20:29:52 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.stilbuero.de/2007/04/07/tabs-27-flexibility/</guid>
		<description><![CDATA[I've added a few requested features and fixed some quirks for the <a href="/jquery/tabs/">Tabs plugin</a> recently.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve added a few requested features and fixed some quirks for the <a href="/jquery/tabs/">Tabs plugin</a> recently.</p>
<h3>Increased flexibility</h3>
<p>For a much increased flexibility regarding the <abbr title="HyperText Markup Language">HTML</abbr> structure required for a tab interface you can now add particular classes to the unordered list and the tab containers. If no classes are present, the elements are queried relying on the default structure. The <code>tabStruct</code> option still works but is deprecated and will go away with the next release (Tabs 3).</p>
<p>Say you need a div wrapped around each the unordered list and the containers. Provide the following <abbr>HTML</abbr>:</p>
<pre><code class="html">&lt;div id=&quot;container&quot;&gt;
     &lt;div&gt;
         &lt;ul class=&quot;tabs-nav&quot;&gt;
             &#8230;
         &lt;/ul&gt;
     &lt;/div&gt;
     &lt;div&gt;
         &lt;div id=&quot;fragment-1&quot; class=&quot;tabs-container&quot;&gt;
             &#8230;
         &lt;/div&gt;
         &lt;div id=&quot;fragment-2&quot; class=&quot;tabs-container&quot;&gt;
             &#8230;
         &lt;/div&gt;
         &lt;div id=&quot;fragment-3&quot; class=&quot;tabs-container&quot;&gt;
             &#8230;
         &lt;/div&gt;
     &lt;/div&gt;
&lt;/div&gt;</code></pre>
<p>That also means that you can easily switch the order of containers and the list:</p>
<pre><code class="html">&lt;div id=&quot;container&quot;&gt;
     &lt;div id=&quot;fragment-1&quot;&gt;
         &#8230;
     &lt;/div&gt;
     &lt;div id=&quot;fragment-2&quot;&gt;
         &#8230;
     &lt;/div&gt;
     &lt;div id=&quot;fragment-3&quot;&gt;
         &#8230;
     &lt;/div&gt;
     &lt;ul class=&quot;tabs-nav&quot;&gt;
          &#8230;
     &lt;/ul&gt;
&lt;/div&gt;</code></pre>
<p>As long as you attach these classes to the proper elements, you can go crazy with your <abbr>HTML</abbr>. The class names are even configurable via option. If the default structure is used, adding the class names does no harm but it is not required. They are of course required for the look of the tabs, but they are attached by the plugin if not present. The underlying (default) <abbr>HTML</abbr> becomes even more unobtrusive that way and it also becomes much easier to add fallback styles for the case of JavaScript being disabled.</p>
<h3>Specify active tab by class</h3>
<p>Instead of specifying the active tab when initializing tabs you can now also simply add the class to the list element representing the desired tab, like:</p>
<pre><code class="html">&lt;li class=&quot;tabs-selected&quot;&gt;</code></pre>
<p>Please note that a given fragment identifier/hash in the <abbr title="Uniform Resource Locator">URL</abbr> will take precedence and the class will be removed if the active tab doesn&#8217;t match. Here&#8217;s how the active tab gets computed: fragment identifier overrules class overrules active tab given as parameter in the initialization.</p>
<h3>onClick enhanced</h3>
<p>Switching tabs is now canceled if the onClick callback returns false. This is useful for instance if proceeding to the next tab requires form validation before.</p>
<h3>Some more changes</h3>
<ul>
<li>
<p>Triggering/Enabling/Disabling tabs can also be done via id instead of an index:</p>
<pre><code class="javascript">$('#tabs').triggerTab(1);</code></pre>
<p>is the same as</p>
<pre><code class="javascript">$('#tabs').triggerTab('#tab-1');</code></pre>
</li>
<li>Fixed a bug (duplicate ids) occuring when multiple Ajax tabs containers are included in the same page. Remote tabs are now numbered consecutively.</li>
<li>There&#8217;s a new option <code>hashPrefix</code> to define a string that is used as base for constructing the id of a remote tab, such as &#8220;#remote-tab-1&#8243;.</li>
<li><a href="/jquery/tabs/">Finally tabs are looking better&#8230;</a></li>
<li>I&#8217;ve fixed a few little quirks in <abbr title="Internet Explorer">IE</abbr> introduced with the Ajax support. Along with that goes an update for the <a href="/jquery/history/">History plugin</a> where I&#8217;ve fixed a minor bug that occured both in <abbr>IE</abbr> and Safari.</li>
</ul>
<p>I consider this the last maintenance release for the Tabs plugin. After I&#8217;ve tackled Thickbox Reloaded I&#8217;m going to rewrite Tabs for Tabs 3, which will allow mixed static/Ajax tabs, easy creating and removing tabs, mouseover tabs&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stilbuero.de/2007/04/07/tabs-27-flexibility/feed/</wfw:commentRss>
		<slash:comments>73</slash:comments>
		</item>
		<item>
		<title>Tabs plugin update: Support for (unobtrusive) Ajax</title>
		<link>http://www.stilbuero.de/2007/02/05/tabs-plugin-update-support-for-unobtrusive-ajax/</link>
		<comments>http://www.stilbuero.de/2007/02/05/tabs-plugin-update-support-for-unobtrusive-ajax/#comments</comments>
		<pubDate>Mon, 05 Feb 2007 17:00:12 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.stilbuero.de/2007/02/05/tabs-plugin-update-support-for-unobtrusive-ajax/</guid>
		<description><![CDATA[I have updated the Tabs plugin the other day. It now supports loading tab
content via Ajax. As one could have expected I did that in an unobtrusive manner.
The HTML you need is slightly different from the one that is used for static tabs: A list of links pointing to existing ressources (from where the content [...]]]></description>
			<content:encoded><![CDATA[<p>I have updated the Tabs plugin the other day. It now supports loading tab<br />
content via Ajax. As one could have expected I did that in an unobtrusive manner.</p>
<p>The <abbr title="HyperText Markup Language">HTML</abbr> you need is slightly different from <a href="/2006/05/13/accessible-unobtrusive-javascript-tabs-with-jquery/">the one that is used for static tabs</a>: A list of links pointing to existing ressources (from where the content gets loaded) and no additional containers at all (unobtrusive!). They&#8217;re going to be created on the fly:</p>
<pre><code class="html">&lt;div id=&quot;container&quot;&gt;
     &lt;ul&gt;
         &lt;li&gt;&lt;a href=&quot;ahah_1.html&quot;&gt;Content 1&lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href=&quot;ahah_2.html&quot;&gt;Content 2&lt;/a&gt;&lt;/li&gt;
         &lt;li&gt;&lt;a href=&quot;ahah_3.html&quot;&gt;Content 3&lt;/a&gt;&lt;/li&gt;
     &lt;/ul&gt;
&lt;/div&gt;</code></pre>
<p>Initialize the tabs interface with the <code class="javascript">remote</code> option set to <code class="javascript">true</code>:</p>
<pre><code class="javascript">$('#container').tabs({remote: true});</code></pre>
<p>Obviously this will degrade gracefully &#8211; the links, e.g. the content, will still be accessible with JavaScript disabled.</p>
<p>All other options and history support should be totally unaffected by that.</p>
<p>There&#8217;s another option: While the tab content is being loaded a little spinner left to the tab title text is shown (which you will hardly see on the <a href="/jquery/tabs/">demo</a>, because it&#8217;s loading too fast). Just like in Firefox for example. This is controlled by a <abbr title="Cascading Style Sheets">CSS</abbr> class, which you can change:</p>
<pre><code class="javascript">$('#container').tabs({remote: true, loadingClass: 'progress'});</code></pre>
<p>If you don&#8217;t want to show a spinner at all just remove the rule</p>
<pre><code class="javascript">.anchors .tabs-selected .tabs-loading {
     ...
}</code></pre>
<p>from the style sheet.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stilbuero.de/2007/02/05/tabs-plugin-update-support-for-unobtrusive-ajax/feed/</wfw:commentRss>
		<slash:comments>148</slash:comments>
		</item>
		<item>
		<title>New kids on the jQuery block</title>
		<link>http://www.stilbuero.de/2007/02/03/new-kids-on-the-jquery-block/</link>
		<comments>http://www.stilbuero.de/2007/02/03/new-kids-on-the-jquery-block/#comments</comments>
		<pubDate>Sat, 03 Feb 2007 15:20:27 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Notebook]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.stilbuero.de/2007/02/03/new-kids-on-the-jquery-block/</guid>
		<description><![CDATA[Sweet! I am an official member of the jQuery team since yesterday.
This is pretty exciting and I&#8217;m looking forward to bring in my capabilities to an already strong team!
]]></description>
			<content:encoded><![CDATA[<p>Sweet! <a href="http://jquery.com/blog/2007/02/02/new-jquery-project-team-members/">I am an official member of the jQuery team since yesterday.</a></p>
<p>This is pretty exciting and I&#8217;m looking forward to bring in my capabilities to an already strong team!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stilbuero.de/2007/02/03/new-kids-on-the-jquery-block/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>A smoother Thickbox (with less code)</title>
		<link>http://www.stilbuero.de/2006/11/06/a-smoother-thickbox-with-less-code/</link>
		<comments>http://www.stilbuero.de/2006/11/06/a-smoother-thickbox-with-less-code/#comments</comments>
		<pubDate>Mon, 06 Nov 2006 00:44:52 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.stilbuero.de/2006/11/06/a-smoother-thickbox-with-less-code/</guid>
		<description><![CDATA[Here's an instruction on how to make the beautiful <a href="http://jquery.com/demo/thickbox/">Thickbox</a> even better. These things came to my mind while I was implementing Thickbox for <a href="http://plazes.com">Plazes</a>. The result is a much smoother Thickbox with much less JavaScript code. ]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s an instruction on how to make the beautiful <a href="http://jquery.com/demo/thickbox/">Thickbox</a> even better. These things came to my mind while I was implementing Thickbox for <a href="http://plazes.com">Plazes</a>. The result is a much smoother Thickbox with much less JavaScript code. </p>
<p>What bothered me was that when scrolling or resizing the browser window the Thickbox modal window gets moved to stay in the center, but that happens not smooth at all and with a little delay (after the resize/scroll events get fired that is).</p>
<p>So I changed the Thickbox <abbr title="Cascading Style Sheets">CSS</abbr> to use fixed positioning, starting with the modal window:</p>
<ol>
<li>
<p>Change <abbr>CSS</abbr> to this:</p>
<pre><code>html, body {
    height: 100%;
}

#TB_window {
    position: fixed;
    top: 50%;
    left: 50%;
    ...
}</code></pre>
</li>
<li>
<p>Remove the scroll and resize event handler:</p>
<pre><code>$(window).scroll(TB_position);
$(window).resize(TB_position);</code></pre>
</li>
<li>
<p>Change the function <code>TB_position</code> to this:</p>
<pre><code>function TB_position() {
     $("#TB_window").css({marginLeft: '-' + parseInt(TB_WIDTH / 2) + 'px', width: TB_WIDTH + 'px'});
     if ( !(jQuery.browser.msie &#038;&#038; typeof XMLHttpRequest == 'function') ) { // take away IE6
         $("#TB_window").css({marginTop: '-' + parseInt(TB_HEIGHT / 2) + 'px'});
     }
     TB_overlaySize();
}</code></pre>
<p>It now pushes the modal window half of its width/height to the left/top from the middle so that it is exactly centered.</p>
</li>
<li>
<p>Fix our special friend <abbr title="Internet Explorer">IE</abbr> 6 to emulate a fixed positioning:</p>
<pre><code>* html #TB_window {
     position: absolute;
     margin-top: expression(0 - parseInt(this.offsetHeight / 2) + (TBWindowMargin = document.documentElement &#038;&#038; document.documentElement.scrollTop || document.body.scrollTop) + 'px');
}</code></pre>
<p>(Based on <a href="http://www.howtocreate.co.uk/fixedPosition.html">http://www.howtocreate.co.uk/fixedPosition.html</a>)</p>
<p>I use the Star Selector hack to hide these styles from <abbr>IE</abbr> 7, which supports fixed<br />
positioning. Because this being invalid <abbr>CSS</abbr>, I recommend inclusion in an extra style sheet via <a href="http://msdn.microsoft.com/workshop/author/dhtml/overview/ccomment_ovw.asp">Conditional Comments</a>.</p>
</li>
<li><em>Smoooooth.</em></li>
<li>
<p>The same consideration applies to the overlay and the spinner. There is still some overhead to compute their dimensions and position depending on the state of the viewport.</p>
<p>Use fixed positioning here as well and make the overlay 100% wide and high:</p>
<pre><code>#TB_overlay {
     position: fixed;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     ...
}

#TB_load {
    position: fixed;
    top: 50%;
    left: 50%;
    margin: -50px 0 0 -50px; /* -height/2 0 0 -width/2 */
    ...
}</code></pre>
</li>
<li>
<p>Change <code>TB_load_position();</code> to <code>$('#TB_load').show();</code> and throw away</p>
<pre><code>function TB_overlaySize(){
    ...
}</code></pre>
<p>and all references to it. Also remove</p>
<pre><code>function TB_load_position() {
    ...
}

function TB_getPageScrollTop(){
    ...
}</code></pre>
<p>Nearly done!</p>
</li>
<li>
<p>The only thing we still need to do is to accommodate <abbr>IE</abbr> 6 with a <a href="http://msdn.microsoft.com/workshop/author/dhtml/overview/recalc.asp">Dynamic Property</a> again:</p>
<pre><code>* html #TB_overlay {
     position: absolute;
     height: expression(document.body.scrollHeight &gt; document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px');
}</code></pre>
<p>And don&#8217;t forget to add <code>* html #TB_load</code>:</p>
<pre><code>* html #TB_window, * html #TB_load {
    ...
}</code></pre>
</li>
</ol>
<p><a href="/demo/thickbox/">Here&#8217;s a demo with all these modifications to the original.</a> Try scrolling and resizing the window and you will see the difference. I&#8217;d really like to see that in a future version of Thickbox. Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stilbuero.de/2006/11/06/a-smoother-thickbox-with-less-code/feed/</wfw:commentRss>
		<slash:comments>37</slash:comments>
		</item>
		<item>
		<title>Tabs Version 2</title>
		<link>http://www.stilbuero.de/2006/11/05/tabs-version-2/</link>
		<comments>http://www.stilbuero.de/2006/11/05/tabs-version-2/#comments</comments>
		<pubDate>Sun, 05 Nov 2006 21:33:22 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.stilbuero.de/2006/11/05/tabs-version-2/</guid>
		<description><![CDATA[Since the <a href="http://stilbuero.de/2006/05/13/accessible-unobtrusive-javascript-tabs-with-jquery/">first release of my jQuery Tabs plugin</a> <a href="http://www.stilbuero.de/2006/06/18/tabs-plugin-revised/">I constantly</a> <a href="http://www.stilbuero.de/2006/07/13/bookmarkable-tabs/">worked on it</a> - which is most notable if you take a look at the <a href="/jquery/tabs/">demo page</a> - but until now I have never officially released a new version. Since I made a little <abbr title="Application Programming Interface">API</abbr> change recently and because I think the plugin is pretty mature now, I hereby announce version 2 of the jQuery Tabs plugin. I'm going to describe all changes and additions since version 1.]]></description>
			<content:encoded><![CDATA[<p>Since the <a href="http://stilbuero.de/2006/05/13/accessible-unobtrusive-javascript-tabs-with-jquery/">first release of my jQuery Tabs plugin</a> <a href="http://www.stilbuero.de/2006/06/18/tabs-plugin-revised/">I constantly</a> <a href="http://www.stilbuero.de/2006/07/13/bookmarkable-tabs/">worked on it</a> &#8211; which is most notable if you take a look at the <a href="/jquery/tabs/">demo page</a> &#8211; but until now I have never officially released a new version. Since I made a little <abbr title="Application Programming Interface">API</abbr> change recently and because I think the plugin is pretty mature now, I hereby announce version 2 of the jQuery Tabs plugin. I&#8217;m going to describe all changes and additions since version 1.</p>
<h3>Licensing</h3>
<p>First of all I changed the licensing for the plugin. The plugin is available under the the same double licensing scheme as jQuery itself is (<a href="http://www.opensource.org/licenses/mit-license.php">MIT</a>/<a href="http://www.gnu.org/licenses/gpl.html">GPL</a>). Thus that should be no problem at all, still I think it&#8217;s worth mentioning.</p>
<h3>Keep track</h3>
<p>The (guaranteed) latest version of the plugin is also available from jQuery&#8217;s plugin repository. Check it out from <samp>svn://jquery.com/plugins</samp> with your Subversion client of choice.</p>
<h3>Packer</h3>
<p>Tabs is packable with <a href="http://dean.edwards.name/packer/">Dean Edward&#8217;s JavaScript Compressor</a>. I fixed errors that occured in the packed script (e.g. a missing semicolon) and replaced <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/jscript7/html/jsConditionalCompilation.asp">Conditional Compilation</a> with checks for <code>jQuery.browser.msie</code>. In fact, the script in the <a href="/jquery/tabs/tabs.zip">downloadable <abbr>ZIP</abbr> file</a> is already packed. The download contains an uncompressed file as well for those of you who like to have a look into the source code.</p>
<h3>Documentation</h3>
<p>I added a complete inline documentation, which can be found in the uncompressed source file.</p>
<h3>Bookmarkability and the back button</h3>
<p><del datetime="2006-12-01T09:41:28+00:00">Tabs are truly bookmarkable. Clicking on a tab changes the hash in the <abbr>URL</abbr>. If you use Tabs together with my newly created <a href="/jquery/history/">History/Remote plugin</a> the back (and forward) button is fixed as well. </del> <ins datetime="2006-12-01T09:41:28+00:00">If you use Tabs together with my newly created <a href="/jquery/history/">History/Remote plugin</a>, tabs are truly bookmarkable, e.g. clicking on a tab changes the hash in the <abbr>URL</abbr> of the browser, as well as support for the back (and forward) button is enabled.</ins> Tabs will auto-detect its presence. Supported browsers are Firefox, Opera, Safari and Internet Explorer. History/Remote is contained in the download.</p>
<h3><abbr>API</abbr> change</h3>
<p>To pass in the tab to be initially activated you no longer specify it with an &#8220;on&#8221; option. Instead you pass the number as first argument to the <code>tabs()</code> function. That&#8217;s the way it was in the very beginning and I found passing in the initial tab as <code>{on: 2}</code> a little too verbose:</p>
<pre><code>$('#container').tabs(2); // start with second tab
$('#container').tabs(2, { /* options */ });</code></pre>
<p>If a hash in the <abbr title="Uniform Resource Locator">URL</abbr> of the page refers to one fragment (tab container) of a tab interface, this parameter will be ignored and instead the tab belonging to that fragment will be activated. If it is omitted it defaults to 1. But because of the bookmarkability of a tab such usage is limited and more or less deprecated anyway. You can always control the active tab on page load by having the appropriate hash in the <abbr>URL</abbr>.</p>
<h3>Optional settings</h3>
<p>All of the following options are key/value pairs in an object literal that is passed to <code>tabs()</code> as an argument . For example:</p>
<pre><code class="javascript">$('#container').tabs({ fxFade: true, fxAutoHeight: true});</code></pre>
<p>It doesn&#8217;t matter if you omit the initial tab parameter or not:</p>
<pre><code class="javascript">$('#container').tabs(2, { fxFade: true, fxAutoHeight: true});</code></pre>
<h3>Effects</h3>
<pre><code class="javascript">fxFade: true</code></pre>
<p>Boolean flag indicating whether fade in/out animations are used for tab switching. Can be combined with <code>fxSlide</code>. Will overrule <code>fxShow</code>/<code>fxHide</code>. Default value: <code>false</code>.</p>
<pre><code class="javascript">fxSlide: true</code></pre>
<p>Boolean flag indicating whether slide down/up animations are used for tab switching. Can be combined with <code>fxFade</code>. Will overrule <code>fxShow</code>/<code>fxHide</code>. Default value: <code>false</code>.</p>
<pre><code class="javascript">fxSpeed: 'fast'</code></pre>
<p>A string representing one of the three predefined speeds (<code>"slow"</code>, <code>"normal"</code>, or <code>"fast"</code>) or the number of milliseconds (e.g. <code>1000</code>) to run an animation. Default value: <code>"normal"</code>.</p>
<pre><code class="javascript">fxShow: {height: 'show', opacity: 'show'}</code></pre>
<p>An object literal of the form jQuery&#8217;s <code>animate</code> function expects for making your own, custom animation to reveal a tab upon tab switch. Unlike <code>fxFade</code> or <code>fxSlide</code> this animation is independent from an optional hide animation. Default value: <code>null</code>. <a href="http://jquery.com/api/">See animate</a>.</p>
<pre><code class="javascript">fxHide: {height: 'hide', opacity: 'hide'}</code></pre>
<p>An object literal of the form jQuery&#8217;s <code>animate</code> function expects for making your own, custom animation to hide a tab upon tab switch. Unlike <code>fxFade</code> or <code>fxSlide</code> this animation is independent from an optional show animation. Default value: <code>null</code>. <a href="http://jquery.com/api/">See animate</a>.</p>
<pre><code class="javascript">fxShowSpeed: 'fast'</code></pre>
<p>A string representing one of the three predefined speeds (<code>"slow"</code>, <code>"normal"</code>, or <code>"fast"</code>) or the number of milliseconds (e.g. <code>1000</code>) to run the animation specified in <code>fxShow</code>. Default value: <code>fxSpeed</code>.</p>
<pre><code class="javascript">fxHideSpeed: 'fast'</code></pre>
<p>A string representing one of the three predefined speeds (<code>"slow"</code>, <code>"normal"</code>, or <code>"fast"</code>) or the number of milliseconds (e.g. <code>1000</code>) to run the animation specified in <code>fxHide</code>. Default value: <code>fxSpeed</code>.</p>
<pre><code class="javascript">fxAutoHeight: true</code></pre>
<p>Boolean flag that if set to <code>true</code> causes all tab heights to be constant (being the height of the tallest tab). Default value: <code>false</code>.</p>
<p><strong>There&#8217;s one more thing about these effects I would like to point out:</strong> Even if you use animations, all the tab contents remain fully printable. This is not granted due to how animations work and you will hardly find that taken into account out there.</p>
<h3>Other options</h3>
<pre><code class="javascript">callback: function(tabToShow, tabToHide) {
    // do something
}</code></pre>
<p>A function to be executed upon tab switch. If animations are used this function is invoked after the animations are completed. The function gets passed two arguments: the first one is the <abbr title="Document Object Model">DOM</abbr> element containing the content of the clicked tab (e.g. the div), the second argument is the one of the tab that gets hidden. Alternatively the former element can also be refered to with the <code>this</code> keyword in the body of the callback function. Default value: <code>null</code>.</p>
<pre><code class="javascript">selectedClass: 'a-css-class'</code></pre>
<p>The <abbr title="Cascading Style Sheets">CSS</abbr> class attached to the li element representing the currently selected tab. Default value: <code>"tabs-selected"</code>.</p>
<pre><code class="javascript">hideClass: 'a-css-class'</code></pre>
<p>The <abbr>CSS</abbr> class used for hiding inactive tabs. A class is used instead of <code>display: none</code> in the style attribute to maintain control over visibility in other media types than screen, most notably print. Default value: <code>"tabs-hide"</code>.</p>
<pre><code class="javascript">tabStruct: 'div&gt;div'</code></pre>
<p>A <abbr>CSS</abbr> selector or basic XPath expression reflecting a nested <abbr title="HyperText markup Language">HTML</abbr> structure that is different from the default single div structure (one div with an id inside the overall container holds one tab&#8217;s content). If for instance an additional div is required to wrap up the several tab containers such a structure is expressed by <code>"div&gt;div"</code>:</p>
<pre><code class="html">&lt;div id=&quot;container&quot;&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;a href=&quot;<strong>#section-1</strong>&quot;&gt;Section 1&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;<strong>#section-2</strong>&quot;&gt;Section 2&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;<strong>#section-3</strong>&quot;&gt;Section 3&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;div&gt;
        &lt;div <strong>id=&quot;section-1&quot;</strong>&gt;
            ...
        &lt;/div&gt;
        &lt;div <strong>id=&quot;section-2&quot;</strong>&gt;
            ...
        &lt;/div&gt;
        &lt;div <strong>id=&quot;section-3&quot;</strong>&gt;
            ...
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;</code></pre>
<p><strong>Recap:</strong> The default <abbr>HTML</abbr> structure the plugin relies on looks like this:</p>
<pre><code class="html">&lt;div id=&quot;container&quot;&gt;
    &lt;ul&gt;
        &lt;li&gt;&lt;a href=&quot;<strong>#section-1</strong>&quot;&gt;Section 1&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;<strong>#section-2</strong>&quot;&gt;Section 2&lt;/a&gt;&lt;/li&gt;
        &lt;li&gt;&lt;a href=&quot;<strong>#section-3</strong>&quot;&gt;Section 3&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
    &lt;div <strong>id=&quot;section-1&quot;</strong>&gt;
        ...
    &lt;/div&gt;
    &lt;div <strong>id=&quot;section-2&quot;</strong>&gt;
        ...
    &lt;/div&gt;
    &lt;div <strong>id=&quot;section-3&quot;</strong>&gt;
        ...
    &lt;/div&gt;
&lt;/div&gt;</code></pre>
<h3>Triggering a tab</h3>
<p>I have also added a function to activate a tab programmatically (&#8221;from outside&#8221;), as if the tab itself were clicked:</p>
<pre><code>$('#container').triggerTab(2);</code></pre>
<p>That would activate the second tab for an interface that was created in <code>#container</code>. Such a function comes in handy if you need <a href="/jquery/tabs/rotate.html">rotating tabs</a> for instance.</p>
<p>Thats it &#8211; have fun! <a href="/jquery/tabs/tabs.zip">Download</a> and <a href="/jquery/tabs/">Demo</a> are still in place.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stilbuero.de/2006/11/05/tabs-version-2/feed/</wfw:commentRss>
		<slash:comments>189</slash:comments>
		</item>
		<item>
		<title>Cookie Plugin for jQuery</title>
		<link>http://www.stilbuero.de/2006/09/17/cookie-plugin-for-jquery/</link>
		<comments>http://www.stilbuero.de/2006/09/17/cookie-plugin-for-jquery/#comments</comments>
		<pubDate>Sun, 17 Sep 2006 11:37:37 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.stilbuero.de/2006/09/17/cookie-plugin-for-jquery/</guid>
		<description><![CDATA[I contributed a cookie plugin for jQuery yesterday. You can get it from the (Subversion) repository:
svn://jquery.com/plugins
Or get it here. A few simple examples of how to use it:
$.cookie('the_cookie'); // get cookie
$.cookie('the_cookie', 'the_value'); // set cookie
$.cookie('the_cookie', 'the_value', { expires: 7 }); // set cookie with an expiration date seven days in the future
$.cookie('the_cookie', '', { expires: [...]]]></description>
			<content:encoded><![CDATA[<p>I contributed a cookie plugin for <a href="http://jquery.com">jQuery</a> yesterday. You can get it from the (Subversion) repository:</p>
<p><samp>svn://jquery.com/plugins</samp></p>
<p><a href="http://jquery.com/dev/svn/trunk/plugins/cookie/jquery.cookie.js?format=txt">Or get it here</a>. A few simple examples of how to use it:</p>
<pre><code>$.cookie('the_cookie'); // get cookie
$.cookie('the_cookie', 'the_value'); // set cookie
$.cookie('the_cookie', 'the_value', { expires: 7 }); // set cookie with an expiration date seven days in the future
$.cookie('the_cookie', '', { expires: -1 }); // delete cookie</code></pre>
<p>You&#8217;ll find the complete documentation inline.</p>
<h3>Update</h3>
<p><a href="http://engelschall.com/">Ralf Engelschall</a> suggested on the jQuery mailing list, that it is more intuitive to delete a cookie by passing <code>null</code> as value:</p>
<pre><code>$.cookie('the_cookie', null); // delete cookie</code></pre>
<p>I agree and updated the plugin accordingly. The old syntax for deleting still works of course.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stilbuero.de/2006/09/17/cookie-plugin-for-jquery/feed/</wfw:commentRss>
		<slash:comments>165</slash:comments>
		</item>
		<item>
		<title>Bookmarkable Tabs</title>
		<link>http://www.stilbuero.de/2006/07/13/bookmarkable-tabs/</link>
		<comments>http://www.stilbuero.de/2006/07/13/bookmarkable-tabs/#comments</comments>
		<pubDate>Thu, 13 Jul 2006 19:11:40 +0000</pubDate>
		<dc:creator>Klaus</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.stilbuero.de/2006/07/13/bookmarkable-tabs/</guid>
		<description><![CDATA[Some further enhancement for the <a href="http://www.stilbuero.de/2006/05/13/accessible-unobtrusive-javascript-tabs-with-jquery/">tabs plugin</a>: the ability to bookmark a tab. It's already in the <a href="http://stilbuero.de/jquery/tabs/#section-3">demo</a> for quite a while but I had not yet posted it (<a href="http://jquery.com/discuss/2006-June/002444/">apart from from the jQuery mailing list</a>).]]></description>
			<content:encoded><![CDATA[<p>Some further enhancement for the <a href="http://www.stilbuero.de/2006/05/13/accessible-unobtrusive-javascript-tabs-with-jquery/">tabs plugin</a>: the ability to bookmark a tab. It&#8217;s already in the <a href="http://stilbuero.de/jquery/tabs/#section-3">demo</a> for quite a while but I had not yet posted it (<a href="http://jquery.com/discuss/2006-June/002444/">apart from from the jQuery mailing list</a>).</p>
<p>The <abbr title="Uniform Resource Locator">URL</abbr> for a page with tabs on it must simply contain a fragment identifier (<code>#hash</code>) which refers to a fragment representing the content of one tab. This makes the belonging tab active and the tab bookmarkable. Try this out on the demo page (look at the tabs on top: without the hash portion in the <abbr>URL</abbr> the first tab is active):</p>
<p><a href="http://stilbuero.de/jquery/tabs/#section-3">http://stilbuero.de/jquery/tabs/<strong>#section-3</strong></a></p>
<p>The tab which link refers to the fragment with the id <code class="html">section-3</code> becomes active:</p>
<pre><code class="html">&lt;!-- tab --&gt;
&lt;li&gt;&lt;a href=&quot;<strong>#section-3</strong>&quot;&gt;Section 3&lt;/a&gt;&lt;/li&gt;</code></pre>
<pre><code class="html">&lt;!-- tab content --&gt;
&lt;div <strong>id=&quot;section-3&quot;</strong>&gt;
    &#8230;
&lt;/div&gt;</code></pre>
<h3>Some notes:</h3>
<p><abbr>URL</abbr> takes precedence over option to compute the active tab in the beginning. Any value that is passed as option to the plugin, like <code class="javascript">{on: 3}</code>, will be ignored if the <abbr>URL</abbr>&#8217;s fragment identifier matches a tab content holder&#8217;s id. If not the active tab is computed as usual (with or without options).</p>
<p>The browser&#8217;s scrollbar stays in place. It will not be scrolled to the specified fragment (if that belongs to a tab that is). This would happen especially if a page has a lot of content and the fragment is nearer to the bottom of the viewport or even below.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.stilbuero.de/2006/07/13/bookmarkable-tabs/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
	</channel>
</rss>
