Custom jQuery plug in implementation of the method to force object redrawing

  • 2020-05-17 04:49:08
  • OfStack

This article illustrates a custom jQuery plug-in approach to force object redrawing. Share with you for your reference. The specific implementation method is as follows:


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';
 });
};

I hope this article has been helpful to your jQuery programming.


Related articles: