In jQuery how can I set “top,left” properties of an element with position values relative to the parent and not the document?

前端 未结 7 992
感情败类
感情败类 2020-12-12 18:43

.offset([coordinates]) method set the coordinates of an element but only relative to the document. Then how can I set coordinates of an element but relative to

相关标签:
7条回答
  • 2020-12-12 19:23

    Code offset dynamic for dynamic page

    var pos=$('#send').offset().top;
    $('#loading').offset({ top : pos-220});
    
    0 讨论(0)
提交回复
热议问题