Skip to content

Instantly share code, notes, and snippets.

@danro
Created August 21, 2012 22:33
Show Gist options
  • Save danro/3420026 to your computer and use it in GitHub Desktop.
Save danro/3420026 to your computer and use it in GitHub Desktop.
Faster jQuery hide / show
define(function (require) {
// dependencies
var $ = require('jquery');
// --------------------------------------------------
// jquery micro-plugin for faster hide/show
//
$.fn.hidey = function () {
return this.each(function () {
$(this).css('display', 'none');
});
};
$.fn.showy = function (value) {
if (!value) value = 'block';
return this.each(function () {
$(this).css('display', value);
});
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment