Simple library for draggable and closeable windows
A new window is easily made, after including the library;
var w = new WindowJS(options);
Options are passed as an associative array to our WindowJS constructor. These are the options available to the window constructor
- title: adds a title to our window. This can be HTML (type: string)
- draggable: defines whether the window is draggable (type: boolean)
- close_button: defines whether or not the window is closeable. Here you can pass a string or an HTML string, with the representation of your close button
- id: adds an id to the window div, otherwise a unique one gets generated
- content: main content of the window, this will usually be an HTML string
- parent: the parent div where the window should be appended into
You can call the show method on the window;
w.show();
This adds the window to the DOM structure
This removes the window;
w.close();
This also removes the window from the DOM