Code Monkey home page Code Monkey logo

stick-to-me's Introduction

🦉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.

Property Description default
layer jQuery select of your popup html empty
fadespeed Controls the speed of the fade animation 400
trigger Where detection of exit intent takes place top
delay Delay before showing popup when exit intent is detected 0
interval Interval between popups 0
maxamount Maximum times the popup will be triggered 0 = unlimited
cookie Set cookie to prevent opening again on the same browser false
cookieExpiration Define the cookie expiration in seconds (if set cookie to true) none (will save the cookie as session cookie)
bgclickclose Clicking on background closes the popup true
escclose pressing ESC closes the popup true
onleave function to be called when popup closes empty fn

Support

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

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

Buy Me A Coffee

License

License

Credits

stick-to-me's People

Contributors

adrai avatar alexmisk avatar guiassemany avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

stick-to-me's Issues

Chrome Autocomplete Triggers pop up

Hi,

When I use chrome auto fill to fill in shipping or user account it is triggering the pop up.

Is there any setting or anything I can do to make it only trigger at the top?

Thanks

Easy to remove PNG image requirement

It's easy to remove the PNG image requirement. Just change the stick-to-me.css so that .stick_block_layer has a background of rgba(0,0,0,0.6) .

CDN

Hi
Great script, any chance of getting it on a CDN?
Thanks
Glennyboy

Add a more professional X closer

You can add a more professional X closer easily by changing the X to &times; and then changing the stick-to-me.css .stick_close to font-family:Arial,sans-serif; font-size: 17px; font-weight:bold;

Cookie duration

Hi there!
I just quickly wanted to ask whether there is a way to set cookie duration once cookies are enabled.

Regards.

Avoid Inline Styles

There's an unnecessary inline style on the stickLayer object. You can simply change the stick-to-me.css stick_popup to include display:none;.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.