Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Performance of Jquery vs CSS tooltips? [closed]

Tags:

jquery

css

I was wondering, if I had say - 100 tooltips what would be the performance comparison if they were jquery or css based? From my understanding, with CSS tooltips, the physical tooltip is created for each item and hidden from view until a user hovers over it - while a jquery tooltip should be only one item that changes content when its hovered upon. Or am I wrong? What do you think I should go with? Thanks!

like image 224
pufAmuf Avatar asked Nov 04 '22 07:11

pufAmuf


1 Answers

It all depends on how many elements will have tooltips and how often they are displayed. For example, if you have few elements to apply tooltips to and they are displayed often, your CSS approach will be better. If you have lots of elements to apply tooltips to and they are not displayed often, your JS approach will be better.

It also depends on the size of the tooltips. The only way to answer your question is to actually try both and see which performs best. Also consider JS is much slower in some browsers. IE 6/7 will not perform well with 50tooltips/s using JS. CSS will still not be great but likely better than JS. You need to try both implementations and test on various browser versions.

like image 143
Paul Fleming Avatar answered Nov 15 '22 07:11

Paul Fleming