Home >Web Front-end >HTML Tutorial >java-web Jquery initialization delay problem_html/css_WEB-ITnose
jQuery performance optimization jsp java web
Now the project is developed using jsp, and there are some elements in the page It uses a bunch of defined js and css to initialize dom elements for style control. Currently used elements such as menu sometimes have a delay of about 1 second without style modification when the page is loaded, but sometimes there is no delay. , I guess it’s due to caching? Personal opinion
Apply the style of the fixed dom element directly to the dom element
or split the script file that controls the style and reference the split script file to the split based node element
or add the outermost div Hide it first, and then control its display in the referenced script file
Make a div to cover it to indicate loading
After jquery has processed the official dom, hide this div