jEasyUI creates XP style left panel


Normally, in the Windows XP Explorer folder, the left panel contains some common tasks. This tutorial shows you how to create an XP left panel using the easyui panel plugin.

34.png

Define some panels

We define some panels, which are used to display some tasks. Each panel should have at least a collapse/expand tool button.

The code is as follows:

	<div style="width:200px;height:auto;background:#7190E0;padding:5px;">
		<div class="easyui-panel" title="Picture Tasks" collapsible="true" style="width:200px;height:auto;padding:10px;">
			View as a slide show<br/>
			Order prints online<br/>
			Print pictures
		</div>
		<br/>
		<div class="easyui-panel" title="File and Folder Tasks" collapsible="true" style="width:200px;height:auto;padding:10px;">
			Make a new folder<br/>
			Publish this folder to the Web<br/>
			Share this folder
		</div>
		<br/>
		<div class="easyui-panel" title="Other Places" collapsible="true" collapsed="true" style="width:200px;height:auto;padding:10px;">
			New York<br/>
			My Pictures<br/>
			My Computer<br/>
			My Network Places
		</div>
		<br/>
		<div class="easyui-panel" title="Details" collapsible="true" style="width:200px;height:auto;padding:10px;">
			My documents<br/>
			File folder<br/><br/>
			Date modified: Oct.3rd 2010
		</div>
	</div>

Customize the appearance of the panel

Please note that the appearance of this view is not what we want, we must change the panel (Panel) header background image and collapse/expand button icon.

It’s not difficult to do this, all we need to do is redefine some CSS.

	.panel-body{
		background:#f0f0f0;
	}
	.panel-header{
		background:#fff url('../style/images/panel_header_bg.gif') no-repeat top right;
	}
	.panel-tool-collapse{
		background:url('../style/images/arrow_up.gif') no-repeat 0px -3px;
	}
	.panel-tool-expand{
		background:url('../style/images/arrow_down.gif') no-repeat 0px -3px;
	}

It can be seen that it is very simple to use easyui to define the user interface.

Download jQuery EasyUI instance

jeasyui-layout-xp.zip