Preface : What is redrawing and reflow ?

Repaint (repaints) It's a browser behavior triggered by a change in the appearance of an element , For example, change vidibility、outline、 Background color and other properties . The browser redraws the element based on its new attributes , Give the element a new look . Redrawing doesn't bring about rearrangement , It doesn't have to be accompanied by backflow .

backflow (reflow) It's a more obvious change , It can be understood that the rendering tree needs to be recalculated .

2.1 CSS Positioning in 、 hide

It was said that , The harm of backflow is to renew the right to DOM Tree rendering , that , After leaving the document stream , Any operation you do , There's no backflow ! If there is a need to do complex operations frequently , Might as well use position:absolute/fixed location ; Or is it display:none, Take it out of the document stream , After the operation is completed, enter the document stream .

2.2 CSS The obstinate nature of

The following attributes , As long as they change their values , It will cause backflow , It is recommended that they be combined to operate , Can reduce the number of reflux . These attributes include :offsetTop、offsetLeft、 offsetWidth、offsetHeight;scrollTop、scrollLeft、scrollWidth、scrollHeight;clientTop、clientLeft、clientWidth、clientHeight;getComputedStyle() 、currentStyle().

Web The front-end development : What is page replay (repaints) And reflow (reflow) More articles about

  1. [ turn ] Web Front end development engineer common technology website arrangement

    1. Common tools Youdao cloud notes http://note.youdao.com/signIn/index.html 36 The town of - Best to use shared favorites http://www.36zhen.com/ Browser synchronization test ...

  2. Web Front end development engineer common technology website arrangement

    1. Common tools Youdao cloud notes http://note.youdao.com/signIn/index.html 36 The town of - Best to use shared favorites http://www.36zhen.com/ Browser synchronization test ...

  3. Web Front end development best practices (4): Add the necessary meta Information

    meta The label is placed in HTML Page head in , It's mainly used to identify websites . It basically contains some description information of the website , for example , brief introduction . Author, etc . This information helps search engines to more accurately identify the content of web pages , It also helps third-party tools to capture the basic information of the website . ...

  4. Web The front-end development essence is recommended (jQuery、HTML5、CSS3)【 Series 12 】

    2012 year 12 month 12 Japan ,[<Web Front end developers and designers must read articles > Series 12 ] I've met you all . Dream sky blog focuses on   The front-end development   technology , Share various ways to enhance the user experience of the website  jQuery  plug-in unit , Show cutting edge  HT ...

  5. use grunt build web Front end development environment

    1. Preface This article aims to explain grunt introduction , And explanation grunt The use of the most commonly used plug-ins . 2. install node.js Grunt And all grunt Plug ins are all based on nodejs To run. , If you don't have it on your computer nodejs, ...

  6. web Front end development learning content

    should Yes Knowledge and skills : understand web standard , Good handwriting xhtml css3 And accord with accord with w3c standard                        Code can Compatible with mainstream browsers .ie6.7.8.9 ff etc. .    ...

  7. Web Front end development engineer development plan 【 Reprint 】

    Web Front end development engineer development plan ( Introduction ) The original advice : There are many people with ideas in this world , But too few people have ideas and can achieve it ! First of all, thanks to the great Web2.0 Concept . Product concept . The concept of user experience .jQuery plug-in unit , They are in China ...

  8. Web Front end development essays collection (jQuery、HTML5、CSS3)【 Series 17 】

    <Web The front-end development essence is recommended >2013 The fifth issue of ( The 17th issue ) I've met you all . Dream sky blog focuses on   The front-end development   technology , Share various ways to enhance the user experience of the website  jQuery  plug-in unit , Show cutting edge  HTML5  and  C ...

  9. 【 Reprint 】WEB Front end development specification document

    This article is reprinted from Tan Xiaojian <WEB Front end development specification document > by A specification document for a new project , Share with you . I think in the front end development process , Whether it's team development , Or stand alone , There is a development document to standardize , It's very beneficial to the development work ...

  10. web Notes on best practices in front end development

    One . The article begins with I've been busy recently , On the one hand, I'm busy with the company , On the other hand, I am busy reading and studying , So there is no time to share knowledge with you , Ok now , Finally back to the blog Garden family , Today I'm going to share some information about <web The front end is on ...

Random recommendation

  1. Give Way div Fixed at the top without scrolling with the scroll bar

    Give Way div Fixed at the top without scrolling with the scroll bar <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "h ...

  2. java io flow When running an error , Save the exception to the file

    java io flow When running an error , Save the exception to the file Here's an example , After operation , Input number , To be right , If the input string , False report , Save error messages // When running an error , Save the exception to the file // Here's an example , After operation , Input number , ...

  3. Exception handling and MiniDump Detailed explanation (4) MiniDump

    http://blog.csdn.net/vagrxie/article/details/4398721 Exception handling and MiniDump Detailed explanation (4) MiniDump classification :             [Wi ...

  4. Android Check memory usage

    One . Use dumpsys meminfo command 1. Use dumpsys meminfo View memory usage 2. Filtering a process can use dumpsys meminfo | grep -i phone Two , Use t ...

  5. I think it's very valuable to share JavaScript subject

    This is a comprehensive topic , If you can sort it out quickly and clearly , Then I believe you are right JavaScript I have a certain understanding . I'll take a picture of the title first , For your consideration , In the end, I give my analysis process and answer , To sum up . good , No nonsense ...

  6. OpenCV MFC Communication between modules

    1. newly build MFC project Click finish . 2. Add a button stay " hold-all " Find "Button" Control , Add to interface :  2. To configure opencv, add to colordetecto ...

  7. Sharepoint2010 adopt WebFeature modify web.config

    using System;using System.Runtime.InteropServices;using System.Security.Permissions;using Microsoft. ...

  8. jQuery The form of pop-up window has always been the center of specific cases

    Check online many It's not that it's invalid ; therefore , Some of my own summary , Solve this problem   principle : common problem : The pop-up layer is in the middle , The background is also translucent   However, I found that as soon as I pulled the scroll bar, I found that the background only set the segment where the screen is located , The rest is the original ...

  9. Learn from scratch Xamarin.Forms( 5、 ... and ) skill

    original text : Learn from scratch Xamarin.Forms( 5、 ... and ) skill because HTML5 To regulate in 2014 year 10 The month was finally finalized , company .net Fewer developers , At home and abroad, there are more mature UI frame . The rapid development of mobile phone software and hardware and so on , So I just ...

  10. Android EditText Button

    main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:and ...