/** * DropKick * * Highly customizable element that gets dropkicked lists = [], // Convenience keys for keyboard navigation keyMap = { 'left' : 37, 'up' : 38, 'right' : 39, 'down' : 40, 'enter' : 13 }, // HTML template for the dropdowns dropdownTemplate = [ '
', '', '{{ label }}', '', '
', '', '
', '
' ].join(''), // HTML template for dropdown options optionTemplate = '
  • {{ text }}
  • ', // Some nice default values defaults = { startSpeed : 1000, // I recommend a high value here, I feel it makes the changes less noticeable to the user theme : false, change : false }, // Make sure we only bind keydown on the document once keysBound = false ; // Called by using $('foo').dropkick(); methods.init = function (settings) { settings = $.extend({}, defaults, settings); return this.each(function () { var // The current list and place our new one in front of it $select.before($dk); // Update the reference to $dk $dk = $('#dk_container_' + id).fadeIn(settings.startSpeed); // Save the current theme theme = settings.theme ? settings.theme : 'default'; $dk.addClass('dk_theme_' + theme); data.theme = theme; // Save the updated $dk reference into our data object data.$dk = $dk; // Save the dropkick data onto the