JavaScript Window

Invoke the close method of the jqxWindow. Author: http://jqwidgets.com

HTML

<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.base.css">
<link rel="stylesheet" href="http://jqwidgets.com/public/jqwidgets/styles/jqx.energyblue.css">
<script src="http://jqwidgets.com/public/jqwidgets/jqx-all.js"></script>
<div id='jqxwindow'>
  <div>Header</div>
  <div>Content</div>
</div>

JavaScript

$('#jqxwindow').jqxWindow({
  theme: 'energyblue'
});
$(document).click(function(e) {
  var container = $('#jqxwindow');
  if (!container.is(e.target) && container.has(e.target).length === 0) {
    container.jqxWindow('close');
  }
});