Jquery实现鼠标hover图片遮罩弹出提示层特效

时间:2021-04-02 21:13:19

1、引入JS文件和所需要的样式文件

2、简单的写上以下18行代码就可以实现了

$(document).ready(function() {

    $("div.tip_trigger a.img").hover(function() {

        $(this).parent('div.tip_trigger').css({

            'background': '#8de08b',

            'z-index': ''

        });

        $('#h_coolsite .block').show();

        tip = $(this).siblings('.tip');

        tip.show();

    },
function() { $(this).parent('div.tip_trigger').css({ 'background': 'none',
'z-index': '' });
$('#h_coolsite .block').hide(); tip.hide();
}) })