Overflow autodetect



</> Source
<!DOCTYPE html>
<html>
<head>
	<title>Overflow autodetect</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");
			myContextMenu = new dhtmlXMenuObject({
				parent: "contextArea",
				icons_path: "../common/imgs/",
				context: true,
				xml: "../common/dhxmenu3.xml",
				overflow: "auto",
				visible_area: {
					x1: window.dhx4.absLeft(pObj),
					x2: window.dhx4.absLeft(pObj)+pObj.offsetWidth,
					y1: window.dhx4.absTop(pObj),
					y2: window.dhx4.absTop(pObj)+pObj.offsetHeight
				}
			});
			// or
			// myContextMenu.setOverflowHeight("auto");
		}
	</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>
	<div><br><br></div>
</body>
</html>

Documentation

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