Display popup on first visit only

Developer
Size
2,094 Kb
Views
36,432

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 Previews

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}});
});
Display popup on first visit only - Script Codes
Display popup on first visit only - Script Codes
Home Page Home
Developer Sjmcpherson
Username sjmcpherson
Uploaded August 21, 2022
Rating 3
Size 2,094 Kb
Views 36,432
Do you need developer help for Display popup on first visit only?

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!

Sjmcpherson (sjmcpherson) Script Codes
Create amazing marketing copy with AI!

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!