Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fading out everything except the element that's being pointed by the mouse

Sort of like a "Lightbox 2" effect but only on the elements pointed by a mouse. I don't even know how to start. Any advice would be awesome, thanks.

like image 774
Tek Avatar asked Feb 26 '23 15:02

Tek


1 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/

like image 106
Ender Avatar answered May 08 '23 13:05

Ender