javascript - Why jQuery height() and width() methods sometimes take too long to calculate element height and width -


i have noticed jquery height() , width() methods take long calculate element height , width. how can optimize ie8+ , latest version of chrome , firefox?

edit - found jquery using offsetheight/offsetwidth can return 0 if you've done dom modifications element recently. calls in settimeout call after you've modified element. 1 of reason of these methods takes more time.

is there way overcome issue?

try saving values in variables, instead call methods time.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -