Show child div on mouse hover of parent - needs javascript?

前端 未结 7 2019
悲哀的现实
悲哀的现实 2021-02-01 13:27

I need to show a div when you house over its parent (default is for the child div to be hidden). Is the only way to do this with javascript? Thanks

7条回答
  •  说谎
    说谎 (楼主)
    2021-02-01 13:54

    With jQuery, absolutely:

    $("#some_parent").hover(function ()
    {
        $(this).children("#some_child_div").show();
    });
    

提交回复
热议问题