Grow from center animation with JQuery

前端 未结 1 618
误落风尘
误落风尘 2021-01-02 10:35

I\'m looking to have a popup div from a button. When the button is clicked, I want the popup to grow outwards from the center of the button and at the same time, slide to t

相关标签:
1条回答
  • 2021-01-02 11:00

    You can use jQuery UI with the show method passing in "scale" as a parameter.

     $('#growwer').show("scale",{}, 1000);
    

    Working example

    To slide your element to the center o the page I've created a modified version of Tony L's jQuery function found here: Using jQuery to center a DIV on the screen.

    Working Example

    Update

    Here's a working example of the two animations running simultaniously:

    http://jsfiddle.net/wNXLY/1/

    To get this to work I included an extra parameter on the animate function passing in: {duration: durationLength, queue: false}

    0 讨论(0)
提交回复
热议问题