Posted By

kendsnyder on 05/28/11


Tagged

javascript jquery


Versions (?)

jQuery plugin to get and set Element#style.display


 / Published in: jQuery
 

Plugin to get and set Element#style.display (e.g. "none" or "")

  1. $.fn.display = function(setTo) {
  2. if (setTo) {
  3. return this.each(function(i, el) {
  4. el.style.display = setTo;
  5. });
  6. }
  7. if (!0 in this) {
  8. return false;
  9. }
  10. return this[0].style.display;
  11. };

Report this snippet  

You need to login to post a comment.