Created
June 29, 2012 21:17
-
-
Save TastyToast/3020700 to your computer and use it in GitHub Desktop.
Arrange birthday fields in page manager
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
//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