Absolute绝对定位
Ext.layout.container.Absolute对应面板布局配置项的Absolute,可以根据子面板中配置的x/y坐标进行定位。
代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Ext.layout.container.Absolute示例</title> <link href="ext-4.0.7-gpl/resources/css/ext-all.css" rel="stylesheet" type="text/css" /> <script src="ext-4.0.7-gpl/bootstrap.js" type="text/javascript"></script> <script type="text/javascript"> Ext.onReady(function () { Ext.create("Ext.panel.Panel", { title: "Ext.layout.container.Absolute示例", frame: true, width: 300, height: 200, renderTo: Ext.getBody(), bodyPadding: 5, layout: "absolute", defaults: { bodyStyle: "background-color:#FFFFFF;padding:15px", frame: true, height: 70, width: 100 }, items: [{ x: 10, y: 10, title: "子面板一", html: "子面板一" }, { x: 130, y: 40, title: "子面板二", html: "子面板二" }] }); }); </script> </head> <body> </body> </html>
效果图:
版权声明:本文为libingql原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。