The attenuation of everything except the element that is indicated by the mouse

It looks like the Lightbox 2 effect, but only the elements that the mouse points to. I donโ€™t even know where to start. Any advice would be great, thanks.

+4
source share
3 answers

Like this:

$(function() { $('*').fadeTo('fast',0.5).hover(function() { $(this).fadeTo('fast',1); }, function() { $(this).fadeTo('fast',0.5); }); }); 

Demo: http://jsfiddle.net/Ender/vJQDx/

+6
source

Have you seen the expose plugin? Perhaps exactly what you are looking for.

+1
source

You asked how to delete everything except the item that is indicated by the mouse. Other answers here show how to fade out in a hovering element rather than disappearing non-hovering elements ...

Here is the answer that hits the point made in your question.

http://jsfiddle.net/g105b/ecJw8/

 $(function() { $("img").mouseover(function() { $("img:not(:hover)").fadeTo("fast", 0.5); }); $("img").mouseout(function() { $("img").fadeTo("fast", 1.0); }); }); 
+1
source

All Articles