Does he prefer the best option initially? Keep in mind that DOM manipulation can be expensive, so anything you can do to mitigate this would be nice
It looks like you better have the image in the background and switch it when you hover over a div.
Sort of:
$("#MyDiv").mouseover(function(){ $(this).find("img").toggle(); }); $("#MyDiv").mouseout(function(){ $(this).find("img").toggle(); });
Or, conversely, use .hover
This is not tested and can be reorganized to be better, but with the idea of ββwhat I get, I hope!
source share