Giter VIP home page Giter VIP logo

gliojs's Introduction

glio

Detects if the mouse of an user leaves the viewport / document borders of your website and when this happens, trigger your callback. Portuguese documentation.

Demo.

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!

Cases:

  • if you are using gliojs, paste your project here.

Articles about Exit-popups:

Install:

  • Npm: npm install gliojs

  • Bower: bower install gliojs

Import the library glio.min.js in 'dist' folder in your site. <script src='glio.min.js'></script>

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.

This software is licensed under the MIT License.

gliojs's People

Contributors

luisvinicius167 avatar

Watchers

James Cloos avatar  avatar

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.