animating div elements left to right and back

后端 未结 3 581
一整个雨季
一整个雨季 2020-12-12 07:46

I have a menu system made up of divs and i want to animate the left property to slide each time the user mouses over a menu item but i need the outer div(which is black) ele

3条回答
  •  既然无缘
    2020-12-12 07:54

    If I could rewrite your html a bit, I would put make each .menu-item into an unordered list.

    When you mouseenter the unordered list, you expand the second container. Inside that mouseenter function, I would have a second event when you mouseenter a list item, you populate the second container and stopPropogation.

    You could probably still do it with a mouseenter on the first container, and another mouseenter on the div.menu-item, but your first container has extra height and width.

提交回复
热议问题