How to position a div dynamically below another?

前端 未结 4 1015
暗喜
暗喜 2021-02-08 01:59

I\'m trying to use jQuery to detect the position of a div (#olddiv), so I can use that position to place another div (#newdiv) exactly below it. The ri

4条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-08 02:47

    There is a pretty cool plugin getting developed by the jQuery UI team that helps with position.

    Lets you do something like this:

    $(".menu").position({ my: "left top", at: "left bottom", of: ".menubutton" });
    

提交回复
热议问题