Last Updated: February 25, 2016
·
617
· gdotdesign

Better :visible selector

$.extend $.expr[":"],
  seen: (elem, i, match, array) ->
    try
      rect = elem.getBoundingClientRect()
      el = document.elementFromPoint(rect.left+1, rect.top+1)
      el is elem or $.contains(elem,el)
    catch e
      false