Created
August 19, 2014 17:03
-
-
Save dannyvassallo/b98b2652484744bdccef to your computer and use it in GitHub Desktop.
This file contains 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
var catItemS = ['.cat-item-45', '.cat-item-36']; | |
var catItemsLength = catItemS.length; | |
for (var i = 0; i < catItemsLength; i++){ | |
orGanize(catItemS[i]); | |
} | |
function orGanize(){ | |
var catItem = catItemS[i] | |
var elem = jQuery( catItem ).find('.children li').sort(sortMe); | |
jQuery( catItem +' .children').append(elem); | |
} | |
function sortMe(a, b) { | |
return a.className > b.className; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment