Originally Posted by
tonyb0709
I've found some useful javascript code which will run and generate a modal pop up window if the user starts to move the mouse to exit the form (using the "mouseleave" event). My question is how to embed that into my web page using Xara Designer pro. Can it be done using a widget?
Any advice or pointers gratefully accepted.
I would try putting the code inside <SCRIPT></SCRIPT> tags within the Page code (head).
It is one of the most annoying things you can put on a site next to instant sounds being played.
The type of jQuery coding is typically:
Code:
var popupCounter = 0;
$(document).mouseleave(function () {
if (popupCounter < 1) {
alert("Please don't close the tab!");
}
popupCounter ++;
});
Of course, being Xara users, we would invoke a Pop-up Layer instead of a simple alert.
Acorn
Bookmarks