how to get bounding box for div element in jquery

后端 未结 3 1457
后悔当初
后悔当初 2021-01-30 13:14

i want to calculate bounding box for div element via jquery/javascript.

i tried like this .

//Left side of box 
document.getElementById(\"myElement\").of         


        
3条回答
  •  醉酒成梦
    2021-01-30 13:45

    using JQuery:

    myelement=$("#myelement")
    [myelement.offset().left, myelement.offset().top,  myelement.width(), myelement.height()]
    

提交回复
热议问题