Exit Intention JS
How do I make an exit intention js?
What is a exit intention js? How do you make a exit intention js? This script and codes were developed by Anthony Young on 31 October 2022, Monday.
Exit Intention JS - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Exit Intention JS</title> <script src="https://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="exitintent"> </div> <div style="height:400px;">Move your mouse or scroll the document.</div>
<div id="info" style="height:65px; width:300px; left:300px; top:100px; background-color:#e0a0a0; position:fixed;"></div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Exit Intention JS - Script Codes CSS Codes
.exitintent { border: 1px solid red; min-height: 60px !important; width: 298px; display: block; float: left; }
Exit Intention JS - Script Codes JS Codes
var _html = document.documentElement;
var delayTimer = null;
fn = function() { jQuery('.exitintent').append('<div style="color: red; padding: 5px;">Exiting intention triggered</div>'); console.log('exit intention');
};
_html.onmouseleave = function(e) { e = e || window.event; if ('clientY' in e) { jQuery('.exitintent').append('<div style="color: red; padding: 5px;">clientY in e</div>'); console.log('clientY in e'); if (e.clientY < 0) { delayTimer = setTimeout(fn, 100); //alert('clientY'); } } else if ('pageY' in e) { jQuery('.exitintent').append('<div style="color: red; padding: 5px;">pageY in e</div>'); console.log('pageY in e'); if (e.pageY < 0) { delayTimer = setTimeout(fn, 100); //alert('pageY'); } } else if ('screenY' in e) { console.log('screenY in e'); if (e.screenY < 100) { delayTimer = setTimeout(fn, 100); //alert('pageY'); } }
};
_html.onmouseenter = function() { if (delayTimer) { clearTimeout(delayTimer); delayTimer = null; }
};
function UpdateInfo (event) { if ('pageX' in event) { // all browsers except IE before version 9 var pageX = event.pageX; var pageY = event.pageY; } else { // IE before version 9 var pageX = event.clientX + document.documentElement.scrollLeft; var pageY = event.clientY + document.documentElement.scrollTop; } var message = "screenX: " + event.screenX + ", screenY: " + event.screenY + "<br />"; message += "clientX: " + event.clientX + ", clientY: " + event.clientY + "<br />"; message += "pageX: " + pageX + ", pageY: " + pageY; var info = document.getElementById ("info"); info.innerHTML = message;
};
_html.onmousemove = function(e) { e = e || window.event; UpdateInfo(e);
};
Developer | Anthony Young |
Username | ayoungh |
Uploaded | October 31, 2022 |
Rating | 3 |
Size | 2,356 Kb |
Views | 32,384 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Awesome textarea | 1,977 Kb |
Send email | 3,253 Kb |
Particle.js play | 2,898 Kb |
Scroll Progress Indicator With jQuery and SVG | 3,444 Kb |
Anthony Young - ayoungh.co.uk Material Design mashup | 5,216 Kb |
JS Countdown Timer | 2,435 Kb |
React - Table with expanding rows | 6,773 Kb |
UL scroll to | 2,036 Kb |
SVG | 1,670 Kb |
Field validation | 2,249 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
A Pen by utcwebdev | Utcwebdev | 2,856 Kb |
Playing with FlexBox | _Billy_Brown | 3,162 Kb |
Simple DevTools | Deegill | 2,511 Kb |
About Us | Francescaedits | 1,902 Kb |
Coburg Banks SVG Logo | Mjtweaver | 3,875 Kb |
Gears | Synvox | 3,278 Kb |
Svg sky | Omodev | 7,070 Kb |
CSS Link Zoom On Click | Bryce | 1,960 Kb |
Flat Star Wars | Kevinjannis | 37,947 Kb |
Segments mouse following | Nosir | 2,909 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!