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

performance: pure css vs jquery

how browsers work - behind scenes of modern web browsers


Comments

Popular posts from this blog

php - render data via PDO::FETCH_FUNC vs loop -

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

The canvas has been tainted by cross-origin data in chrome only -