Skip to content

Instantly share code, notes, and snippets.

@levi
Created February 1, 2010 02:00
Show Gist options
  • Save levi/291393 to your computer and use it in GitHub Desktop.
Save levi/291393 to your computer and use it in GitHub Desktop.
(function($) {
$.fn.fakeSelect = function() {
$(this).each(function(idx, element) {
var container = $(element),
heading = $('h3', element),
menu = $('.dropdown', element);
container.addClass('fakeselect-js');
heading.click(function() {
container.addClass('fakeselect-js-active');
$(document.body).bind('click', function() {
container.removeClass('fakeselect-js-active');
});
});
});
return this;
};
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment