animating div elements left to right and back

后端 未结 3 612
一整个雨季
一整个雨季 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:50

    You should be able to fix the left is null issue by having the code not execute on the last .content, like this:

    $('.container').not(':last').find('.menu-item').mouseenter(function () {
    

    This will not apply to the menu-items within the green box.

    For the re-show issue, I would change the way you are showing. Instead of sliding the box out from behind the other, you can position it where you want it to end up and hide it, then you can use:

    .animate({width: 'show'})
    

    Which will give a similar sliding effect.

    That, or do it similar to my response to your other question, only without the collapsing I had previously:

    http://jsfiddle.net/V3RHr/3/

提交回复
热议问题