Finding the position of bottom of a div with jquery

前端 未结 8 643
粉色の甜心
粉色の甜心 2020-12-07 18:29

I have a div and want to find the bottom position. I can find the top position of the Div like this, but how do I find the bottom position?

var top = $(\'#bo         


        
8条回答
  •  北海茫月
    2020-12-07 19:01

    This is one of those instances where jquery actually makes it more complicated than what the DOM already provides.

    let { top, bottom, height, width, //etc } = $('#bottom')[0].getBoundingClientRect();
    return top;
    

提交回复
热议问题