Skip to content

Instantly share code, notes, and snippets.

@TastyToast
Created June 29, 2012 21:17
Show Gist options
  • Save TastyToast/3020700 to your computer and use it in GitHub Desktop.
Save TastyToast/3020700 to your computer and use it in GitHub Desktop.
Arrange birthday fields in page manager
//CHANGE ORDER OF BIRTHDAY SELECTS
var birthdayFields = [];
birthdayFields = $('.engagements_field_birthday').find('select');
//ARRANGE SELECTS
function arraymove(arr, fromIndex, toIndex) {
element = arr[fromIndex];
arr.splice(fromIndex,1);
arr.splice(toIndex,0,element);
};
arraymove(birthdayFields, 0, 2);
$('.engagements_field_birthday').find('select').remove();
$(birthdayFields).each(function() {
$('.engagements_field_birthday li:first-child').next().append($(this));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment