avoid double event with the special case of the top/bottom of the element being 0