Skip to content

A jQuery plug-in to display a message to a user on their first visit to a page.

License

Notifications You must be signed in to change notification settings

chriscook/first-visit-popup

Repository files navigation

First Visit Popup

Version 1.2

Introduction

First Visit Popup is a jQuery plug-in which shows the user a message on their first visit to a web page.

How to use it

  1. Add the file (jquery.firstVisitPopup.js) to your project, along with jQuery.
  2. Add an element to the page for your popup message.
  3. Add the following jQuery to your page, to be executed on load:
	$('#my-welcome-message').firstVisitPopup({
		cookieName : 'homepage',
		showAgainSelector : '#show-message'
	});

...where '#my-welcome-message' is a selector for the element added in step 2, cookieName is a name for cookie which will determine whether or not to show the message again, and showAgainSelector is the selector of an element on the page the user can click to show the message again (optional).

The script doesn't add any styling information, so you'll have to manually place the elements and hide them. See demo.html for an example.

Author and Acknowledgements

About

A jQuery plug-in to display a message to a user on their first visit to a page.

Resources

License

Stars

Watchers

Forks

Packages

No packages published