Over a million developers have joined DZone.

DIV Sorter

DZone's Guide to

DIV Sorter

Free Resource
// This is a jQuery plugin. It is alternate of Table Sorter, as it will sort the DIV

 * To change this template, choose Tools | Templates
 * and open the template in the editor.

(function($) {
    $.fn.divSorter = function(settings) {
        settings = jQuery.extend({
            container: '',
            column_prefix: 'sortindex_',
            class_normal: 'div_sorter_normal_class',
            class_asc: 'div_sorter_asc_class',
            class_desc: 'div_sorter_desc_class',
        }, settings);

        return this.each(function(){

            this_id = $(this).attr('id');

            $('#'+this_id+' div').each(function(i){

                    if( !$(this).hasClass(settings.classNotToUse) ){
                    $(this).bind('click', function(){
                        $('#'+this_id+' div').removeClass(settings.class_asc);
                        $('#'+this_id+' div').removeClass(settings.class_desc);

                        div_sorter_sort_column_function( settings.container, settings.column_prefix + (i+1), this,  settings.class_desc,  settings.class_asc);


var div_sorter_column_index;
function div_sorter_sort_column_function( Div_container, column_div, obj, class_desc, class_asc ){

    if(div_sorter_column_index && div_sorter_column_index == column_div){
        div_columns_data = $("div." + column_div ).sort(function(a,b){

            if ($(a).attr('isNum') != undefined){
                    return $(a).attr('isNum') - $(b).attr('isNum') ;
                return a.innerHTML < b.innerHTML ? 1 : -1;
        div_sorter_column_index = null;
        div_columns_data = $("div." + column_div ).sort(function(a,b){
            if ($(a).attr('isNum') != undefined)
                return $(b).attr('isNum') - $(a).attr('isNum');
                return a.innerHTML > b.innerHTML ? 1 : -1;
        div_sorter_column_index = column_div;

    for(i = 0; i < div_columns_data.length; i++){
        $('#' + Div_container).append( $(div_columns_data[i]).parent() );

Purchase Soma without a prescription. Soma from mexico without prescription. Soma medicine. Soma without prescription overnight delivery.  Buy online pharmacy Xanax. Xanax shipped with no prescription. Xanax cheap next day. Xanax buy. Buy cash delivery Tramadol. Cheap Tramadol prescriptions. Buy Tramadol without a perscription. Tramadol 1 day delivery.  Overnight delivery of Ambien with no prescription. Buy cheap cod online Ambien. Buy cheap Ambien cod free fedex. Order Ambien for over night delivery. Order Fioricet next day delivery. Fioricet online no prescription fedex. How to buy Fioricet online without a prescription. Fioricet delivery to US Pennsylvania. Xanax order a prepaid mastercard. Buy not expensive fedex Xanax. Online pharmacy Xanax. Buy drug Xanax. Overnight Soma cod. Soma cheap overnight fedex. Buy Soma from online pharmacy with saturday delivery. Soma no rx overnight. No prior perscription Ativan. Buy cheap Ativan prescriptions online. Ativan with free dr consultation. No prescriptonAtivan. Purchase Cialis free next day air. Buy Cialis overnight. Cialis pay by cod. Cialis no rx cod. Phentermine cod saturday delivery fedex. Phentermine cod saturday. Buy cheap Phentermine cod free fedex. Phentermine pill. Amoxicillin fedex no prescription. Buy cheap online Amoxicillin. Buy Amoxicillin rx. Amoxicillin Cash Delivery Cod. Cheap legal Meridia for sale. Meridia cheapest. Order Meridia without rx. Nextday Meridia cash on deliver cod. Valtrex online consultant. Valtrex cash on delivery overnight. Overnight Valtrex. How to get Valtrex without. Xenical and overnight. Buy cheapest online Xenical. Cheap Xenical sales. Xenical online ordering. Carisoprodol overnight cod. Buy Carisoprodol from mexico online. Buy Carisoprodol cheap cod. Buy Carisoprodol in Miami. Buy Codeine on line without a prescription. Buy Codeine mail order. Buy Codeine cod accepted. Codeine wo. Adderall without prescription medications. Buy Adderall offshore no prescription fedex. Cheapest Adderall available online. Adderall no prescription cod. Order Percocet cod fedex. Percocet overnight delivery saturday. Percocet delivery to US New York. Buy Percocet in San Francisco. Buy Oxycontin with no rx. Buy Oxycontin ems delivery. Cheap order prescription Oxycontin. Cheap Oxycontin next day delivery. Cash on delivery Oxycodone no rx. Oxycodone prescriptions. Oxycodone no doctor. Oxycodone online c o d. Lortab order online no membership overnight. Lortab delivery to US North Carolina. Buy Lortab on line. Lortab cod orders. Cheap order Vicodin. Vicodin doctor. Discount Vicodin online. Cheap Vicodin buy online. Hydrocodone cod orders. Hydrocodone next day delivery cod. Order Hydrocodone credit card. Hydrocodone online consultant. Cheap Alprazolam prescriptions online. How to get prescription of Alprazolam. Buy Alprazolam paypal. Alprazolam with no rx and free shipping. Non prescription Ultram. Cheap Ultram cash on delivery. Where can i buy Ultram online. Ultram with next day delivery. Valium cheap fed ex delivery. Valium delivered overnight. Valium delivery to US Georgia. Valium fedex no prescription. No prescription cod Viagra. Buy Viagra in Phoenix. Buy cheap Viagra prescriptions online. Buying Viagra. Online us pharmacy Zolpidem. C.o.d Zolpidem. Cheap Zolpidem without a prescription. Cod overnight Zolpidem. Diazepam delivered cod fedex. Diazepam cheap online. Diazepam c.o.d.. Buy Diazepam free shipping. Cheap Tramadol buy online. Tramadol order online no membership overnight. Buy cheap fedex Tramadol. Tramadol without persription. I want to order Ambien without a perscription. Images of Ambien. Buy Ambien over the counter online. Ambien online with no prescription or membership. Real Fioricet fed ex. Fioricet cod overnight delivery. Buy Fioricet with no rx. Fioricet discount. Ativan with no rx and free shipping. Cod Ativan for saturday. Ativan discounted.Ativanorder a prepaid mastercard.  Meridia delivery to US New Mexico. Meridia online consultation overnight. Buy Meridia in Milwaukee. Purchase Meridia COD.  Order Carisoprodol next day delivery. Carisoprodol overnight cheap. Carisoprodol free consultation fedex overnight delivery. Overnight delivery Carisoprodol. Buy Alprazolam 0.5mg no scams. Alprazolam 1mg prescription online. Buy Alprazolam tablets no scams. Alprazolam 0.25 mg delivery to US Virginia. Free shipping Ultram 50mg. Ultram for cheap. Buy Ultram w/out insurance. Ultram without prescriptions.  Valium diazepam no prescription. Buy cheap Valium 5mg free fedex shipping. Saturday delivery overnight Valium 5mg. Buy Yellow valium pills amex without prescription. Buy Zolpidem coupon overnight. Zolpidem tartrate pharmacies accepting cod delivery. Zolpidem medication order online. Purchase Zolpidem hemitartrate without a prescription. Diazepam 10mg tab uk cash on delivery. Fedex Diazepam diazepam 5mg online cod. Diazepam valium order online no membership overnight. Diazepam valium delivered cod fedex. Tramadol no script. Overnight Tramadol for cats. Buy Tramadol vicodin without a prescription overnight delivery. Tramadol prescription. Ambien tablet no prescription. Cheap order prescription Ambien. Ambien overnight without prescription. Ambien cr without prescription cod. Buy Fioricet pill online with overnight delivery. Buy Fioricet 120 count cheap. I want to order Fioricet tablet without a perscription. Buy Fioricet drug on line. Purchase Soma cod shipping. Buy cheap discounted Soma sleep. Buy Soma in Los Angeles. Soma 350 buy cod.  Order Xanax 2 mg no insurance. Buy Xanax xr paypal without prescription. Buy Xanax bars in Fort Worth. Xanax 1 mg delivery to US South Carolina. Tramadol hydrochloride delivery to US California. Not expensive Tramadol prescriptions. Buy Tramadol for dog paypal. Tramadol vicodin delivery to US South Dakota. Cheap Ambien 10mg next day. Ambien medication delivery to US Colorado. Ambien xr buy online cheap. Ambien tablet shipped c.o.d.  Soma oral no prescription worldwide. Buying 350mg soma over the counter fedex. Buy Soma for pets in Fort Worth. Offshore Soma online. No script Drug ativan. Purchase Ativan valium online. Buy Ativan valium online with overnight delivery. Ativan tablet free usa shipping. Cialis pill fedex no prescription. Cialis drug next day cash on delivery. Snorting Cialis 100 mg. Cheap Cialis tadalafil no prescription next day delivery. Phentermine pill for sale cod. Generic phentermine without prescription. Watson Diet phentermine fedex. Phentermine p diet pill online c o d. Ic amoxicillin delivery to US Texas. Ic amoxicillin without prescription mexico. Amoxicillin tablet delivery to US Hawaii. Buy cheapest Amoxicillin tablet online. ADDERALL TRAMADOL ZOLPIDEM CODEINE ATIVAN AMOXICILLIN OXYCONTIN LORTAB TRAMADOL PERCOCET FIORICET SOMA OXYCODONE CELEBREX ACYCLOVIR LEXAPRO CELEXA LIPITOR PAXIL DICLOFENAC PRILOSEC ULTRACET WELLBUTRIN ZANAFLEX ZOCOR ZOLOFT ZYBAN ZYRTEC ACOMPLIA ZOVIRAX CIPRO CLOMID SYNTHROID NEXIUM ATIVAN AMOXICILLIN CODEINE

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}