javascript - How to select elements within boundary? -



javascript - How to select elements within boundary? -

i'm trying figure out way select elements overlapped (and contained, covered up) within absolutely positioned div.

i need select elements within pixel boundary. how can done using jquery?

here's basic idea:

var left = 100, top = 200, right = 300, bottom = 500; $('#main-div').children().filter(){ var $this = $(this), offset = $this.offset(), rightedge = $this.width() + offset.left, bottomedge = $this.height() + offset.top; if (offset.top > top && offset.left > left && right > rightedge && bottom > bottomedge) { homecoming true; } homecoming false; });

change coordinates @ top whatever need.

javascript jquery

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -