show/hide a div on hover and hover out

后端 未结 6 633
梦谈多话
梦谈多话 2020-12-08 10:27

I would like to show and hide a div during hover and hover out.

here\'s what I\'ve done lately.

css

6条回答
  •  轮回少年
    2020-12-08 10:37

    May be there no need for JS. You can achieve this with css also. Write like this:

    .flyout {
        position: absolute;
        width: 1000px;
        height: 450px;
        background: red;
        overflow: hidden;
        z-index: 10000;
        display: none;
    }
    #menu:hover + .flyout {
        display: block;
    }
    

提交回复
热议问题