Skip to main content

Bug Tracker

Side navigation

Ticket #1319: jquery_test.html


File jquery_test.html, 3.5 KB (added by davidserduke, December 16, 2007 11:29AM UTC)

test case (slightly modified so can download)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
<html>
<head>
<meta http-equiv="Content-Language" content="en" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery Vertical splitter</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="http://methvin.com/jquery/splitter/splitter.js"></script>

<!-- General page styles (not critical to the demos) -->
<link rel="stylesheet" type="text/css" href="http://methvin.com/jquery/splitter/main.css" />

<style type="text/css" media="all">

body {
	padding: 10px;
}

/*
 * Splitter container. Set this to the desired width and height
 * of the combined left and right panes. In this example, the
 * height is fixed and the width is the full width of the body,
 * less the margin on the splitter itself.
 */
#MySplitter {
	height: 400px;
	margin: 1em 3em;
	border: 4px solid #aca;
	/* No padding allowed */
}
/*
 * Left-side element of the splitter. Use pixel units for the
 * min-width and max-width; the splitter plugin parses them to
 * determine the splitter movement limits. Set the width to
 * the desired initial width of the element; the plugin changes
 * the width of this element dynamically.
 */
#LeftPane {
	background: #e9e;
	padding: 4px;
	overflow: auto;
	width: 150px;		/* optional, initial splitbar position */
	min-width: 50px;	/* optional */
	/* No margin or border allowed */
}
/*
 * Right-side element of the splitter.
 */
#RightPane {
	background: #88fff8;
	padding: 4px;
	min-width: 100px;
	overflow: auto;
	/* No margin or border allowed */
}
/* 
 * Splitter bar style; the .active class is added when the
 * mouse is over the splitter or the splitter is focused
 * via the keyboard taborder or an accessKey. 
 */
#MySplitter .vsplitbar {
	width: 6px;
	background: #aca url(vgrabber.gif) no-repeat center;
}
#MySplitter .vsplitbar.active, #MySplitter .vsplitbar:hover {
	background: #e88 url(vgrabber.gif) no-repeat center;
}
</style>
<script type="text/javascript">
//window.onload = (function() {
$().ready(function() {
	$("#MySplitter").splitter({
		type: 'v',
		initA: true,	// use width of A (#LeftPane) from styles
		accessKey: '|'
	});
	// Firefox doesn't fire resize on page elements
	$(window).bind("resize", function(){
		$("#MySplitter").trigger("resize"); 
	}).trigger("resize");
});
</script>
</head>
<body>

<h1>jQuery Vertical Splitter</h1>
<p>
<a href="default.html">See the splitter documentation</a>
</p>
<div id="MySplitter">

	<div id="LeftPane">
		<p>This is the left side of the vertical splitter. Typically you might use this side for a navigational display of some data that is related to the right side.</p>
		<p>Using CSS styles you can control the look of the splitter, such as its color, width, and appearance when selected. Or, you can specify most options when you call the plugin to create the splitter.</p>
	</div>
	
	<div id="RightPane">
		<p>This is the right side of the vertical splitter. Usually this side will be wider than the left side, but that's up to you. The left pane of this demo was set to be 150 pixels wide in the stylesheet, which is why it's smaller than the right side. If you don't specify a width for either panes when the splitter is created, the two panes will be equal width.</p>
		<p>To move the splitbar using the keyboard, press Alt-Shift-I (Mac users, Cmd-Shift-I), then press the arrow keys. To unfocus the splitbar, press Tab.</p>
	</div>

</div>

</body>
</html>

Download in other formats:

Original Format