Set visible area

</> Source
<!DOCTYPE html>
<html>
<head>
	<title>Set visible area</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
	<link rel="stylesheet" type="text/css" href="../../../codebase/fonts/font_roboto/roboto.css"/>
	<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
	<script src="../../../codebase/dhtmlx.js"></script>
	<script>
		var myContextMenu;
		function doOnLoad() {

			var pObj = document.getElementById("contextArea");
			var x1 = window.dhx4.absLeft(pObj);
			var x2 = x1+pObj.offsetWidth;
			var y1 = window.dhx4.absTop(pObj);
			var y2 = y1+pObj.offsetHeight;

			myContextMenu = new dhtmlXMenuObject({
				parent: "contextArea",
				icons_path: "../common/imgs/",
				context: true,
				xml: "../common/dhxmenu.xml"
			});
			myContextMenu.setVisibleArea(x1, x2, y1, y2);
		}
	</script>
</head>
<body onload="doOnLoad()">
	<div id="contextArea" style="position: relative; left: 20px; top: 20px; width: 600px; height: 400px; border: #C1C1C1 1px solid; background-color: #E7F4FF;"></div>
</body>
</html>

Documentation

Check documentation to learn how to use the components and easily implement them in your applications.