To get the offset values from jquery

前端 未结 3 1174
孤城傲影
孤城傲影 2021-02-04 19:23

How do i find the offset value of an image, which is enclosed with in a table. The table consist of lot of images. i want to get the offset - left, right, top, bottom for all th

3条回答
  •  臣服心动
    2021-02-04 19:56

    var elem = $("your_element");
    var offset = elem.offset();
    var leftValue = offset.left;
    var topValue =  offset.top;
    

    To get right and bottom values add width and height values to left and top..

提交回复
热议问题