I need to know if there is a way I can determine if a div is in the center of the screen.
3条回答 一向 (楼主) 2021-01-02 11:41 This is nice method: elementFromPoint() You can get the element in the center as so: var elem = document.elementFromPoint($(window).width()/2, $(window).height()/2); //if you want jquery element you can get it. var jqueryElem = $(elem); 0 讨论(0) 查看其它3个回答 发布评论: 提交评论 加载中... 验证码 看不清? 提交回复
This is nice method: elementFromPoint()
You can get the element in the center as so:
var elem = document.elementFromPoint($(window).width()/2, $(window).height()/2); //if you want jquery element you can get it. var jqueryElem = $(elem);