Is it possible to apply hover element in jQuery to two divs with show and hide function?

There are some flickers when I use shows and hide functionality in my divs. Now I use the following code:

$(document).ready(function(){ $("#tekstvanitem-1").hide(); $("#thumbnail-1").hover(function(){ $("#tekstvanitem-1").show(); },function(){ $("#tekstvanitem-1").hide(); }); }); 

The problem is when I flip thumbnail-1, it shows text-1. But because tekstvanitem-1 appears above sketch-1, it looks like its flicker because im is not on thumbnail-1. So this is a kind of loop.

Is it possible to set a hover element when either my mouse is on thumbnail-1, or if my mouse is on textite-1?

early!

+8
jquery html hide hover show
source share
1 answer

Of course. Just put #tekstvanitem-1 in the selector ...

 $(document).ready(function(){ $("#tekstvanitem-1").hide(); $("#thumbnail-1, #tekstvanitem-1").hover(function(){ $("#tekstvanitem-1").show(); },function(){ $("#tekstvanitem-1").hide(); }); }); 
+5
source share

All Articles