Desktop

扩展组件 » Desktop

创建 Desktop

  1. $('body').desktop({
  2. apps: [{
  3. name: 'Computer',
  4. icon: 'images/computer.png',
  5. width: 800,
  6. height: 400,
  7. left: 200,
  8. top: 50,
  9. href: '_layout.html'
  10. },{
  11. name: 'Network',
  12. icon: 'images/network.png',
  13. left: 300,
  14. top: 100
  15. },{
  16. name: 'Monitor',
  17. icon: 'images/monitor.png',
  18. left: 400,
  19. top: 150
  20. }],
  21. menus: [{
  22. text: 'About Desktop',
  23. handler: function(){
  24. $('body').desktop('openApp', {
  25. icon: 'images/win.png',
  26. name: 'About',
  27. width: 400,
  28. height: 200,
  29. href: '_about.html'
  30. })
  31. }
  32. },{
  33. text: 'System Update...',
  34. handler: function(){
  35. $('body').desktop('openApp', {
  36. name: 'System Update'
  37. })
  38. }
  39. }]
  40. });

属性

名称 类型 描述 默认
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 返回已经打开的应用程序。

下载EasyUI扩展:

jquery-easyui-desktop.zip