获取和设置元素的jQuery插件#样式.显示

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了获取和设置元素的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. };

以上是关于获取和设置元素的jQuery插件#样式.显示的主要内容,如果未能解决你的问题,请参考以下文章