<?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>(function() { &#187; thablesorter</title>
	<atom:link href="http://maxb.net/blog/tag/thablesorter/feed/" rel="self" type="application/rss+xml" />
	<link>http://maxb.net/blog</link>
	<description>// MAXB.NET LABS</description>
	<lastBuildDate>Mon, 16 May 2011 19:12:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>ThableSorter 0.9</title>
		<link>http://maxb.net/blog/2008/04/24/thablesorter-09/</link>
		<comments>http://maxb.net/blog/2008/04/24/thablesorter-09/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 10:05:52 +0000</pubDate>
		<dc:creator>Massimiliano Balestrieri</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[thablesorter]]></category>

		<guid isPermaLink="false">http://maxb.net/blog/?p=14</guid>
		<description><![CDATA[DEMO ZIP]]></description>
			<content:encoded><![CDATA[<p><a href="/scripts/thablesorter/0.9/doc/">DEMO</a></p>
<p><a href="/scripts/thablesorter/0.9/thablesorter-0.9.tar.gz">ZIP</a></p>
<pre class="brush: jscript; title: ; notranslate">
/*
 *
 * ThableSorter 0.9 - Thead Fixed for Tablesorter
 * $Date: 2008-04-24 17:02:29 +0200 (gio, 24 apr 2008) $
 * $Rev: 23 $
 * @requires jQuery v1.2.3
 * @requires TableSorter 2.0.3
 *
 * Copyright (c) 2008 Massimiliano Balestrieri
 * Examples and docs at: http://maxb.net/blog/
 * Licensed GPL licenses:
 * http://www.gnu.org/licenses/gpl.html
 *
 */

ThableSorter = {
    options : {},
    build     : function(options)
    {

        ThableSorter.options = options || {};
        return this.each(
            function(nr)
            {
                //setto un po' di variabili
                var height      = ThableSorter.options.height || 150;

                var box_id      = 'thable-' + nr + '-thfixed';
                var clone_id = 'thable-' + nr + '-clone';
                var target      = 'thable-' + nr + '-target';
                var wrapper  = '&lt;div class=&quot;thfixed&quot; id=&quot;'+ box_id +'&quot;&gt;&lt;div class=&quot;thfixed-head&quot;&gt;&lt;div class=&quot;thfixed-head-box&quot; id=&quot;'+target+'&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;thfixed-body&quot;&gt;&lt;/div&gt;&lt;/div&gt;';

                //jQuery DOM reference
                var Jtable  = jQuery(this);
                var Jparent = Jtable.parent();
                console.log(Jtable.css('width'));

                //creo il wrapper e lo appendo al parent della table. sposto la table dentro al wrapper
                Jparent.append(wrapper);
                jQuery(&quot;#&quot; + box_id + &quot;&gt;.thfixed-body&quot;).append(Jtable);//sposta? magico. non me lo spiego tanto

                var Jclone = Jtable.clone();
                jQuery(&quot;tbody&quot;, Jclone).empty();

                jQuery(&quot;#&quot; + target).append(Jclone);

                //stili wrapper
                jQuery(&quot;.thfixed, .thfixed-head&quot;).css({&quot;overflow&quot; : &quot;hidden&quot;,&quot;position&quot;:&quot;relative&quot;, &quot;width&quot; : Jtable.css('width')});
                jQuery(&quot;.thfixed-body&quot;).css({&quot;overflow&quot; : &quot;auto&quot;,&quot;position&quot;:&quot;relative&quot;, &quot;height&quot; : height});

                Jclone.css({&quot;margin&quot;:&quot;0&quot;});
                Jtable.css({&quot;margin-top&quot;:&quot;0&quot;});

                //jQuery DOM reference
                var Jbuttons = jQuery(&quot;thead&gt;tr&gt;th&quot;, Jtable);
                var Jtrh     = jQuery(&quot;thead&gt;tr&quot;, Jtable);
                var Jtd      = jQuery(&quot;tbody&gt;tr&gt;&quot;, Jtable);
                var Jtriggers= jQuery(&quot;thead&gt;tr&gt;th&quot;, Jclone);

                Jtriggers.each(
                    function(nr){
                        var width = parseInt(Jbuttons.eq(nr).css('width'));
                        jQuery(this).attr('style' , 'width:'+ width + 'px');

                        //td width
                        if(nr == (Jtriggers.length - 1))
                            width -= 10;

                        Jtd.eq(nr).attr('style' , 'width:'+ width + 'px');

                        jQuery(this).click(function(){

                            Jtriggers.each(function(nr2){
                                if(nr !== nr2){
                                    jQuery(this).removeClass('headerSortDown');
                                    jQuery(this).removeClass('headerSortUp');
                                }
                            });

                            //triggero il bottone della tabella originale
                            Jbuttons.eq(nr).trigger('click');

                            //setto le freccine
                            var classes = jQuery(this).attr('class').split(&quot; &quot;);
                            //console.log(classes);
                            if(classes[1]){
                                if(classes[1] == 'headerSortDown'){
                                    jQuery(this).removeClass('headerSortDown');
                                    jQuery(this).addClass('headerSortUp');
                                }else if (classes[1] == 'headerSortUp'){
                                    jQuery(this).removeClass('headerSortUp');
                                    jQuery(this).addClass('headerSortDown');
                                }
                            }else{
                                jQuery(this).addClass('headerSortDown');
                            }
                        });

                    }

                );

                //nascondo il th della tabella originale
                Jtrh.css('display','none');

            }
        );

    }
};
jQuery.fn.thablesorter = ThableSorter.build;

//default
jQuery(document).ready(function(){
    jQuery(&quot;.tablesorter&quot;).tablesorter().thablesorter();
});
</pre>
]]></content:encoded>
			<wfw:commentRss>http://maxb.net/blog/2008/04/24/thablesorter-09/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

