Akno

Simple, fast and beautiful modal windows

akno /aknó/, n. Belarusian
1. window

Features

Demos

Usage

Using Akno is really simple. It has a pure JavaScript API, plus an optional jQuery plugin.

Include the plugin on the page.

<!DOCTYPE html>
<html>
  <head>
    <script src="dist/scripts/akno.min.js"></script>
    <link rel="stylesheet" href="dist/styles/akno.min.css">
  </head>
</html>

This will load the Akno object into the global window object.

var akno = new Akno(document.getElementById('dialog'));
// ... somewhere later
akno.close();

Include the plugin on the page after jQuery reference.

<!DOCTYPE html>
<html>
  <head>
    <script src="jquery.min.js"></script>
    <script src="dist/scripts/akno.jquery.min.js"></script>
    <link rel="stylesheet" href="dist/styles/akno.min.css">
  </head>
</html>

Then use the plugin.

$('#signupDialog').akno();
// ... somewhere later
$('#signupDialog').akno('close');

API

Instance

Options

buttons

Specifies which buttons should be provided on the akno.

Each array element is a configuration object defining the text, the class name, and the click handler to set on the button.

Format:

    {
      text: 'Display Name',
      className: 'optional-class-name-1 class-name-2',
      action: function() {
        // click event handler
        // `this` context is the akno instance.
      }
    }
  

Array
not set
open

Defines if the akno should be shown upon initialization.

Boolean
true
title

Specifies the title of the akno. Header will not rendered in case the parameter is not provided.

String
not set
effect

Specifies how to animate the akno.

String
scale-up
  • scale-up
  • slide-in-right
  • slide-in-bottom
  • newspaper
  • fall
  • side-fall
  • sticky-top
  • flip-hor
  • sign
  • scale-down
  • just-me
  • split
  • rotate-bottom
  • rotate-left

Methods

open

Opens the akno.

close

Closes the akno.

Events

akno-before-open

This event is triggered immediately when open method is called.
The akno will not open if cancelled using Event.preventDefault().

akno-open

This event is triggered when the akno was opened. All animations and transitions are completed.

akno-before-close

This event is triggered immediately when close method is called.
The akno will not close if cancelled using Event.preventDefault().

akno-close

This event is triggered when the akno was hidden. All animations and transitions are completed.

This is a modal window. You can do the following things with it: