back var warned=false; $('#linkcontainer').monitorDistance(function(distance) { this.css('border-color', 'rgb('+Math.floor(255-2*distance)+',0,0)'); }, {max:100}); $('#linkcontainer a').monitorDistance(function(distance) { if(!warned) { alert('DUDE! What has been seen, cannot be unseen!'); warned=true; } else { return false; } }, {max:200});