For this you will need to use this code snippet below:

 function addshopInitPortal(){
    document.addEventListener("mouseout", function(e) { //on mouseout
    e = e ? e : window.event;
    if(AddShopPortal.mouseOutThreshold(e, "top,left,right") && !AddShopPortal.cookieCheck("ASPopped")){ //direction can be top, bottom, left, right, can do miltiple "top,left,right"
                AddShopPortal.init(AddShoppersPortalConfig);
            AddShopPortal.cookieSet("ASPopped",1,.1);
        }
  }
}


-This sets an event listener for mouseout
-It check the threshold areas as the top, left and right to see if the mouse abandoned from one of those sides
-After that it also checks if a cookie exists so it only initiates for the user once
-If the cookie does not exist it will initiate the portal and set the cookie with a value of 1 and a lifetime (in days) that you can set to not fire for the user again.

Did this answer your question?