How to make jQuery animation less jerky (video example)

I am a beginner in jQuery and Javascript. Thank you for reading!

https://www.youtube.com/watch?v=s-E_VFbRruc This is a video demonstrating my code animation so far. As you can see there is lag time between when I mouse over a pixel and when the rectangles containing that pixel display.

Ideally I would like the animation to look like this: https://www.youtube.com/watch?v=rqU12MHzO-I, this time an example I made using the maphilight plugin. But I cannot use that plugin on my code since I want to display many layers of rectangles at once.

I am showing the rectangles (divs) with the jQuery .show() method, but when I try .show("fast") the divs flicker in and out randomly.

Do you have any advice on what I should try?

The relevant code is:

(My code uses a map called 'demo' with many area elements (rectangles) appended to it. In this piece of code I convert each area element to a CSS div so I am able to show and hide them)

I tend to try and rely on CSS for hiding and showing content whenever possible. For example, the css hover selector might be useful here. It's pretty instantaneous, and doesn't require the overhead of waiting on javascript logic.

Notice in this snippet how the blocks are not visible until you run your mouse over them in the top left corner of the results. This seems to be more of what you're looking for. When hover is no longer being applied, it resumes it's original state. By applying a single, reusable class to your divs, the css can be applied individually to each div - and only that div - as it becomes necessary. I this case, "necessary" is on hover of that div at that time.