<box on:mouseDown="onMouseDown();"/> function onMouseDown() { var eventObj = shell.currentEvent(); if (eventObj) { var boxY = eventObj.boxY; if (boxY >= 0) { // the mouse is below (or on) the top edge of the targetBox } else { // the mouse is above the top edge of the targetBox } } }