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
Post a Comment