本文實例講述了自定義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程序設計有所幫助。
新聞熱點
疑難解答