Is it better to use CSS :hover or jQuery hover? -
which better website speed, css :hover or jquery hover? or same?
css
- css native (built browsers), html parser , javascript engine
- css styles exposed scripting languages via cssom - css object model defines apis media queries, selectors , css itself
- implementation not happen through scripting language (unless layout engine written in one)
jquery
- jquery javascript library, , therefore external browsers
- needs downloaded , run through browser's implementation of javascript
- jquery need access dom , cssom, implemented in javascript, browser has run
so, theoretically, while can use jquery , css both use onevent
methods, css faster, native browsers, , not have added step download , "translate" library.
more information
Comments
Post a Comment