Skip to content

Instantly share code, notes, and snippets.

@geetfun
Created October 23, 2009 02:35
Show Gist options
  • Save geetfun/216591 to your computer and use it in GitHub Desktop.
Save geetfun/216591 to your computer and use it in GitHub Desktop.
To sort order
orderize: function(options) {
var sortOrder = [];
if (!options) {
var options = $.shopscaler.productOptions.container.find("li");
options.each(function(i) {
sortOrder.push($(this).attr("id").split("-")[2]);
});
} else {
$.each(options, function() {
alert(this.split("-")[2]);
var id = this.split("-")[2];
if (typeof(id) == "undefined") {
sortOrder.push("123123123");
} else {
sortOrder.push(this.split("-")[2]);
};
});
};
return sortOrder;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment