1.0.2 • Published 3 years ago

stick-to-me v1.0.2

Weekly downloads
341
License
ISC
Repository
github
Last release
3 years ago

🦉The jQuery plugin "Stick to me" allows you to create exit-popups on your web page, so you can capture visitors just as they are about to leave.

How it Works

Stick-to-me tracks the user mouse movement and detects when to trigger the popup. See it in action on gif below.


Table of Contents

Installation

You can install this package through npm

npm install stick-to-me

-- OR --

Just download the zip file and extract on your assets folder.

Usage

1 - Include CSS and JS files on your project

	<!-- stick-to-me -->
	<link rel="stylesheet" type="text/css" href="path/to/stick-to-me.css">
	<script src="path/to/stick-to-me.js"></script>

2 - Write your popup markup

<div id="stickLayer" style="display:none;" class="stick_popup">
	<div class="stick_close" onclick="$.stick_close()">X</div>
	<div class="stick_content">
	    <h1>Hello! I got your attention!</h1>
	</div>
</div>

3 - Tell stick-to-me the id of your popup

<script>
	$(document).ready(function(){
		$.stickToMe({
			layer: '#stickLayer'			
		});
	});
</script>

Customisation

Stick to me allows a few customisations. See options below.

PropertyDescriptiondefault
layerjQuery select of your popup htmlempty
fadespeedControls the speed of the fade animation400
triggerWhere detection of exit intent takes placetop
delayDelay before showing popup when exit intent is detected0
intervalInterval between popups0
maxamountMaximum times the popup will be triggered0 = unlimited
cookieSet cookie to prevent opening again on the same browserfalse
cookieExpirationDefine the cookie expiration in seconds (if set cookie to true)none (will save the cookie as session cookie)
bgclickcloseClicking on background closes the popuptrue
escclosepressing ESC closes the popuptrue
onleavefunction to be called when popup closesempty fn

Support

If you need help, reach out to me at one of the following places!

  • Website at assemany.com
  • E-mail guilherme@assemany.com

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Postcardware

You're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Rua Dias de Toledo, 91, Vila da saúde, São Paulo / SP - Brazil.

Donations

License

License

Credits