All samples are using Ink.requireModules, please read how to use it at Ink.requireModules section

Ink.UI.Close class

Subscribes clicks on the document.body. Whenever an element with the classes ".ink-close" or ".ink-dismiss" is clicked, this module finds an ancestor ".ink-alert" or ".ink-alert-block" element and removes it from the DOM. This module should be created only once per page.

Methods
Method name Description
new Close() Constructor

new Ink.UI.Close()

Example

                <script>
                    Ink.requireModules(['Ink.UI.Close_1'],function( Close ){
                        new Close();
                    });
                </script>
            
            

Initializing close

Demo

Code

<div class="ink-alert basic" role="alert">
    <button class="ink-dismiss">&times;</button>
    <p>Click the X to close this!</p>
</div>

<script>
    // Not needed with autoload.js
    Ink.requireModules(['Ink.UI.Close_1'],function( Close ){
        // Notice that the Close module doesn't take a selector as a parameter.
        // This is because it is page-wide. You only need to call this once.
        new Close();
    });
</script>