Created
December 23, 2011 00:16
-
-
Save cloudxero/1512449 to your computer and use it in GitHub Desktop.
DealerTrend API - Reorder VRS tabs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function() { | |
if (jQuery('body.home').length) { | |
// Only put as many variables as there are tabs | |
var first_tab; | |
var second_tab; | |
var third_tab; | |
var fourth_tab; | |
jQuery('.vrs-widget-item-wrapper').tabs('destroy'); | |
jQuery('.vrs-widget-item-wrapper ul li').each(function(index) { | |
var tab = jQuery(this); | |
// Remove/Add any tab variables | |
if (tab.children().text().match(/chevrolet/i) != null) { | |
first_tab = tab; | |
} else if (tab.children().text().match(/cadillac/i) != null) { | |
second_tab = tab; | |
} else if (tab.children().text().match(/buick/i) != null) { | |
third_tab = tab; | |
} else if (tab.children().text().match(/gmc/i) != null) { | |
fourth_tab = tab; | |
} | |
}); | |
jQuery('.vrs-widget-item-wrapper ul').html(); | |
// Remove/Add any tab variables | |
jQuery('.vrs-widget-item-wrapper ul').append( first_tab ); | |
jQuery('.vrs-widget-item-wrapper ul').append( second_tab ); | |
jQuery('.vrs-widget-item-wrapper ul').append( third_tab ); | |
jQuery('.vrs-widget-item-wrapper ul').append( fourth_tab ); | |
jQuery('.vrs-widget-item-wrapper').tabs(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment