Force DOM redraw/refresh on Chrome/Mac

前端 未结 24 2190
轻奢々
轻奢々 2020-11-22 02:11

Every once in a while, Chrome will render perfectly valid HTML/CSS incorrectly or not at all. Digging in through the DOM inspector is often enough to get it to realize the

24条回答
  •  野性不改
    2020-11-22 03:05

    Sample Html:

    Js:

      jQuery.fn.redraw = function() {
            return this.hide(0,function() {$(this).show(100);});
            // hide immediately and show with 100ms duration
    
        };
    

    call function:

    $('article.child').redraw(); //<==bad idea

    $('#parent').redraw();
    

提交回复
热议问题