Fix "elementInView" function (use intersection check)