网络编程 
首页 > 网络编程 > 浏览文章

自定义jQuery插件方式实现强制对象重绘的方法

(编辑:jimmy 日期: 2026/3/4 浏览:3 次 )

本文实例讲述了自定义jQuery插件方式实现强制对象重绘的方法。分享给大家供大家参考。具体实现方法如下:

jQuery.fn.redraw = function(){
 jQuery(this).each(function(){
   this.style.display='none';
   this.offsetHeight;
// no need to store this anywhere, the reference is enough
   this.style.display='block';
 });
};

希望本文所述对大家的jQuery程序设计有所帮助。

上一篇:JavaScript将数字转换成大写中文的方法
下一篇:jQuery定义背景动态切换效果的方法