How to overlay div / box on mouseover?

前端 未结 3 2241
借酒劲吻你
借酒劲吻你 2021-02-15 11:14

I have a link and when user hover mouse over it, it should display a box (div) under the link. The box should overlay whatever is under it. How can I do it using css or javascri

3条回答
  •  误落风尘
    2021-02-15 12:18

    I have created a sample here. You can modify from there to suit your needs.

    Hover here
    ​ $(document).ready(function() { $("div.hover").mouseover(function () { $(this).css('cursor', 'pointer'); $("div.overlay").css('visibility','visible'); }); $("div.hover").mouseout(function () { $(this).css('cursor', 'default'); $("div.overlay").css('visibility','hidden'); }); });

提交回复
热议问题