check if the target element is visible or not, fixes #233