HTML tree full width hover effect

前端 未结 3 1669
醉话见心
醉话见心 2021-01-16 06:55

I have an html tree which is mostly consisting of nested unordered lists.

I need to create a full width hover effect for each leaf, something similar with windows fi

3条回答
  •  萌比男神i
    2021-01-16 07:34

    A solution changing only the part of the CSS under "hack". I assume that at least you can change that

    CSS

    /*Full width hack*/
    .tree.fullWidth { overflow: hidden; }
    .tree.fullWidth li .item .overlay { right: -8px; width: 314px; left: auto !important; }
    

    demo

    If the tree has a variable width, this is better:

    .tree.fullWidth li .item .overlay { 
        right: -8px; 
        width: 300px;
        padding-left: 14px; 
        left: auto !important; 
    }
    

    It works exactly like the other version, but now the width is the same that the tree width, so the Javascript doesn't need to set a magic width (that you don't know from where it comes:

提交回复
热议问题