Display popup on first visit only
How do I make an display popup on first visit only?
Fancybox popup that display to the user on first visit then uses a cookie to stop users seeing the popup again. What is a display popup on first visit only? How do you make a display popup on first visit only? This script and codes were developed by Sjmcpherson on 21 August 2022, Sunday.
Display popup on first visit only - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Display popup on first visit only</title>
</head>
<body> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.min.css" />
<a id="popuplink" href="#inline" style="display:none;"></a>
<div id="inline" style="display:none;text-align:center;">
<img src="http://thebeachfurniture.co.nz/newbeach-logo.png" alt="" id="logo">
<h3 style="margin-top:20px;">The Beach Furniture has changed its name to Urban & Beach Furniture</h3>
<p>But we will continue providing the same beautifully crafted character furniture</p>
<p><a href="javascript:;" onclick="jQuery.fancybox.close();" style="background-color:#333;padding:5px 10px;color:#fff;border-radius:5px;text-decoration:none;">Close</a></p>
</div>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/2.1.5/jquery.fancybox.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-cookie/1.4.0/jquery.cookie.js"></script> <script src="js/index.js"></script>
</body>
</html>
Display popup on first visit only - Script Codes JS Codes
jQuery(document).ready(function () { function openFancybox() { setTimeout(function () { jQuery('#popuplink').trigger('click'); }, 500); }; var visited = jQuery.cookie('visited'); if (visited == 'yes') { // second page load, cookie active } else { openFancybox(); // first page load, launch fancybox } jQuery.cookie('visited', 'yes', { expires: 365 // the number of days cookie will be effective }); jQuery("#popuplink").fancybox({modal:true, maxWidth: 400, overlay : {closeClick : true}});
});
Developer | Sjmcpherson |
Username | sjmcpherson |
Uploaded | August 21, 2022 |
Rating | 3 |
Size | 2,094 Kb |
Views | 36,432 |
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 |
Overiding fixed image sizing for Responsive websites | 1,467 Kb |
File API demo | 2,178 Kb |
Expanding Info Box | 2,992 Kb |
CSS backface-visibility contact form | 4,686 Kb |
AngularJS View only DOM manipulation | 1,817 Kb |
CSS Only Animated Tooltip | 3,218 Kb |
Shake Me Error Signup Form using Angular | 6,758 Kb |
CSS3 3D Shirt Flipper | 2,242 Kb |
A Pen by sjmcpherson | 2,105 Kb |
Blockquote design | 1,863 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 |
APortfolio | Skybutterfly | 5,174 Kb |
Simple jQuery Slider | Jurbank | 2,874 Kb |
CSS Colors | Alexpate | 2,232 Kb |
Hamburger Menu Animation | Salmanraza | 2,580 Kb |
LeMandinque | Aadesida | 9,046 Kb |
SVG Text Masking | JMChristensen | 2,141 Kb |
Emberjs Bootstrap Modal Carousel | Somethingkindawierd | 4,233 Kb |
Draggable directive | YahyaKacem | 2,277 Kb |
Pure CSS Dial | Lukewatts | 3,018 Kb |
CSS3 Form Page Design | Rssatnam | 3,613 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!