Modal plugin

jSuites.modal brings a very lightweight modal option to your applications.


1

Examples


Simple modal


<html>
<script src="https://bossanova.uk/jsuites/v2/jsuites.js"></script>
<link rel="stylesheet" href="https://bossanova.uk/jsuites/v2/jsuites.css" type="text/css" />

<div id='modal' title='Modal Example'>
    <div>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been
    the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type
    and scrambled it to make a type specimen book. It has survived not only five centuries, but also the
    leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s
    with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with
    desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</div>
</div>

<input type='button' value='Click here to open the modal' onclick='modal.open()' class='plain'>

<script>
var modal = jSuites.modal(document.getElementById('modal'), {
    width:'600px',
    height:'480px',
    closed:true,
    onclose:function() {
        console.log('Modal is closed');
    },
    onopen:function() {
        console.log('Modal is opened');
    },
});
</script>

</script>
</html>

Simple modal with external content


<html>
<script src="https://bossanova.uk/jsuites/v2/jsuites.js"></script>
<link rel="stylesheet" href="https://bossanova.uk/jsuites/v2/jsuites.css" type="text/css" />

<div id='modal' title='Remote content'></div>

<input type='button' value='Click here to open the modal' onclick='modal.open()' class='plain'>

<script>
var external = jSuites.modal(document.getElementById('modal2'), {
    src: '/jsuites/test.html',
    width: '600px',
    height: '480px',
    closed: true
});
</script>

</script>
</html>


2

Methods

open();Open the modal
close();Close the modal


3

Events

onopenTrigger a method on the modal is opened.
oncloseTrigger a method on the modal is closed.


4

Initialization options

var defaults = {
    url: null,
    onopen: null,
    onclose: null,
    closed: false,
    width: null,
    height: null,
    title: null,
};