开发者

jQuery 'grey' out rest of page apart from div user is hovering on

I am working on a dashboard project where the art director wishes to have an affect similar to the one seen here:

http://www.asos.com/

Except when the user hovers over a dashboard 'widget' then there is an overlay over all other elements on the page including the body in much the same way as Colorbox et all.

I was thinking of creating a new div that spans the e开发者_如何学Cntire width of the viewport with z-index 2, all non-active widgets have z-index 3 and the active hovered widget has z-index 1.

Has anyone seen or attempted this to great effect?

Thanks.


siblings

<ul class="listOfImages">
    <li><img ... /></li>
    <li><img ... /></li>
    <li><img ... /></li>
</ul>
<script>
 $('.listOfImages li').hover(function(){
    $(this).siblings().fadeOut();
 }, function(){
    $(this).siblings().fadeIn();
 }
 );
</script>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜