Some front-end processing tips

1. Clear the timer 
part of the animation effects required js automatically generated, time control using the timeout and innertal, which timerout contains innertal, click on the event and the timer is not the same js file, click back and forth quickly, a timer Clear It does not work. 
Solution: All the timers of the corresponding page li li bound to the body, each click when clearing timeout and innertal.

2. The motion processing shaded fold line 
inclined to change the height div, and changes the value of the case where the top and left according to mathematical logic by JS, div movement occurs when offset and jitter. 
Solution: div a motion reference point, so that div when in motion there is no need to change the top and left values, only need to change the width or height can be.

3. parabolic motion 
css two motions are rectilinear motion. 
Solution: a rotation angle to the original point, so look there is a parabolic feeling.

4. The mask layer is processed 
in the multi-level html rendering, the effect of the intermediate mask layer can not be achieved. 
Solution: In the bottom of the mask layer may be used, but the effect of the intermediate mask levels required for image processing, image into png, then css operation.

5. Caton processing 
in Firefox and ie, the effect of slow-moving small icon will appear Caton. 
Solution: exercise time to time, determine if it is not chrome browser, reduced exercise time.

6. optimize performance 
using the picture of slow loading speed of the animation so that, affecting the user experience. 
Solution: on the part of the picture can be used instead of using div div generation, code, compression depth picture uploading.

Guess you like

Origin www.cnblogs.com/lanlanJser/p/11874863.html