EasyUI
Desktop
扩展组件 » Desktop
创建 Desktop
- $('body').desktop({
- apps: [{
- name: 'Computer',
- icon: 'images/computer.png',
- width: 800,
- height: 400,
- left: 200,
- top: 50,
- href: '_layout.html'
- },{
- name: 'Network',
- icon: 'images/network.png',
- left: 300,
- top: 100
- },{
- name: 'Monitor',
- icon: 'images/monitor.png',
- left: 400,
- top: 150
- }],
- menus: [{
- text: 'About Desktop',
- handler: function(){
- $('body').desktop('openApp', {
- icon: 'images/win.png',
- name: 'About',
- width: 400,
- height: 200,
- href: '_about.html'
- })
- }
- },{
- text: 'System Update...',
- handler: function(){
- $('body').desktop('openApp', {
- name: 'System Update'
- })
- }
- }]
- });
属性
名称 | 类型 | 描述 | 默认 |
---|---|---|---|
shortcutSize | number | 快捷图标大小。 | 90 |
winWidth | number | 窗口默认宽度。 | 600 |
winHeight | number | 窗口默认高度。 | 300 |
wallpaper | string | 墙纸图片。 | null |
buttons | selector | 要附加到任务栏的按钮选择器。 | null |
方法
名称 | 参数 | 描述 |
---|---|---|
options | none | 返回options对象。 |
openApp | app |
打开应用:.
代码实例: $('body').desktop('openApp', { icon: 'images/win.png', name: 'About', width: 400, height: 200, href: '_about.html' }) |
setWallpaper | wallpaper | 设置桌面背景。 |
getOpenedApps | none | 返回已经打开的应用程序。 |