Skip to content

MichaelTessier/gliojs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

glio

What is new in this version 2

  • CommonJs support
  • Cookie support with optional expiry date
  • Set a timed delay before the script starts tracking exit intent.
Chrome logo Firefox logo Internet Explorer logo Opera logo Safari logo
17+ ✔ 14+ ✔ 9+ ✔ 17+ ✔ 5+ ✔

Reasons for use

  • Increase your conversion rates!
  • Give visitors reasons to stay!
  • Grab your users’ attention!

Articles about Exit-popups

Install

  • Npm: npm install gliojs-2

Usage

The arguments are a Arrays, where the first index is the direction and the second is a callback.

glio( [ direction, callback ] );

5 Directions

  • top
  • top-left
  • top-right
  • bottom-left
  • bottom-right

Example

  • top-left and top-right
    glio.init(
      [ 'top-left', function () {
          alert('this is top-left');
        }
      ],
      [ 'top-right', function () {
          alert('this is top-right');
        }
      ]
    );
  • all directions
  glio.init(
    [ 'top', function () {
        alert('this is top.');
      }
    ],
    [ 'top-left', function () {
        alert('this is top-left');
      }
    ],
    [ 'top-right', function () {
        alert('this is top-right');
      }
    ],
    [ 'bottom-left', function () {
        alert('this is bottom-left');
      }
    ],
    [ 'bottom-right', function () {
        alert('this is bottom-right');
      }
    ]
  );

Configurations

  • glio.config.key = value; Set the configuration before the init.
  • screenWidthFragment: the quantity of parts the height and width screen will be divided. Default: 12.
  • centerTopHeight: height of 'top' direction. When the mouse is equal or major this value, the callback is triggered. Default: 10.
  • heightTopLeft: height of 'top-left' direction. When the mouse is equal or major this value, the callback is triggered. Default: 30.
  • heightTopRight: height of 'top-right' direction. When the mouse is equal or major this value, the callback is triggered. Default: 30.
  • cookiesExpiration: the value in day of the expiration of cookie. Default: 30.
  • delay: the value in seconds of delay. Default: 0

This software is licensed under the MIT License.

About

Exit popup easely. Detects if the mouse of a user leaves the viewport borders of your website

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 94.5%
  • HTML 5.5%