diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2008-12-26 10:18:38 +0000 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2008-12-26 10:18:38 +0000 |
commit | 7a5803057952f6fdbc2f423d1fadc36b448df057 (patch) | |
tree | 7425f1838259d29060426b0c16fa443ca45f4b57 | |
parent | d1620877db4ce4ecc3385dc6a628e13942f83ca9 (diff) | |
download | jquery-ui-7a5803057952f6fdbc2f423d1fadc36b448df057.tar.gz jquery-ui-7a5803057952f6fdbc2f423d1fadc36b448df057.zip |
accordion: Fixed #3682, setting overflow:auto for fillSpace:true accordions; added demo
-rw-r--r-- | demos/accordion/fillspace.html | 44 | ||||
-rw-r--r-- | demos/accordion/index.html | 1 | ||||
-rw-r--r-- | ui/ui.accordion.js | 7 |
3 files changed, 49 insertions, 3 deletions
diff --git a/demos/accordion/fillspace.html b/demos/accordion/fillspace.html new file mode 100644 index 000000000..a96e6392b --- /dev/null +++ b/demos/accordion/fillspace.html @@ -0,0 +1,44 @@ +<!doctype html> +<html lang="en"> +<head> + <title>jQuery UI Accordion - FillSpace Demo</title> + <link type="text/css" href="../demos.css" rel="stylesheet" /> + <link type="text/css" href="../../themes/default/ui.all.css" rel="stylesheet" /> + <script type="text/javascript" src="../../jquery-1.2.6.js"></script> + <script type="text/javascript" src="../../ui/ui.core.js"></script> + <script type="text/javascript" src="../../ui/ui.accordion.js"></script> + <script type="text/javascript"> + $(function() { + $("#accordion-mouseover").accordion({ + event: "mouseover", + header: "h3", + fillSpace: true + }); + }) + </script> +</head> +<body> + +<div id="accordion-mouseover" style="width: 200px; height: 250px"> + <div> + <h3><a href="#">Nullam blandit</a></h3> + <div> + Duis pretium. Nullam venenatis. Donec ornare. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed sit amet magna ac lorem elementum euismod. Nulla eu leo. Phasellus purus arcu, semper sed, scelerisque eget, molestie vitae, ante. Nam et purus. Vivamus nec lacus. Mauris pulvinar vehicula orci. Nunc quam metus, iaculis ut, viverra at, tempor vel, arcu. Aliquam dictum massa non diam. Pellentesque vel odio. Integer volutpat placerat velit. Phasellus rhoncus, diam ac fermentum suscipit, velit est eleifend dolor, et cursus massa pede et diam. Cras eu tortor. Quisque vitae ante nec erat venenatis luctus. Donec commodo suscipit nulla. Nunc nec ligula id nulla dictum dictum. + </div> + </div> + <div> + <h3><a href="#">Aliquam nulla</a></h3> + <div> + Ut varius. Cras gravida, ante vel porttitor porttitor, sapien magna eleifend dolor, sit amet eleifend justo neque sit amet neque. Donec a nisl sed orci pharetra sodales. Proin ullamcorper, mi sit amet tempor blandit, dolor diam vestibulum nibh, eu sollicitudin lorem risus quis tellus. Ut scelerisque consequat ipsum. Vivamus tellus velit, faucibus eu, venenatis sit amet, varius eu, turpis. In molestie nisi id purus. Pellentesque et dolor. Proin metus nisl, sollicitudin at, aliquet eu, porta eget, est. Donec ut libero. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; + </div> + </div> + <div> + <h3><a href="#">Proin tincidunt</a></h3> + <div> + Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Ut quam massa, scelerisque sit amet, lacinia sit amet, facilisis ullamcorper, nunc. Nulla vehicula auctor felis. Nullam lobortis erat quis metus. Maecenas molestie, quam lobortis tincidunt ultricies, dolor ante rutrum nisl, in vestibulum nisi odio consectetur enim. Nam tellus felis, ultrices nec, elementum malesuada, congue quis, lacus. Aliquam hendrerit interdum eros. Etiam egestas iaculis urna. Cras venenatis pharetra nunc. Etiam scelerisque mauris eget massa. Nam nec lectus eu purus tempus feugiat. Nunc quam. In facilisis venenatis nisl. Nullam id sapien. Nullam lacinia quam facilisis sem. Nullam facilisis convallis justo. Praesent dictum facilisis purus. Integer cursus ligula at nibh. Mauris in felis id nisl porttitor auctor. Quisque erat. + </div> + </div> +</div> + +</body> +</html> diff --git a/demos/accordion/index.html b/demos/accordion/index.html index 54412586c..7b472c9e5 100644 --- a/demos/accordion/index.html +++ b/demos/accordion/index.html @@ -16,6 +16,7 @@ <dt>Accordion</dt>
<dd><a href="default.html">Default</a></dd>
<dd><a href="mouseover.html">Mouseover</a></dd>
+ <dd><a href="fillspace.html">FillSpace</a></dd>
</dl>
</body>
diff --git a/ui/ui.accordion.js b/ui/ui.accordion.js index 39dfc55bf..2fa08dd21 100644 --- a/ui/ui.accordion.js +++ b/ui/ui.accordion.js @@ -141,7 +141,8 @@ $.widget("ui.accordion", { var maxPadding = 0; options.headers.next().each(function() { maxPadding = Math.max(maxPadding, $(this).innerHeight() - $(this).height()); - }).height(maxHeight - maxPadding); + }).height(maxHeight - maxPadding) + .css('overflow', 'auto'); } else if ( options.autoHeight ) { maxHeight = 0; options.headers.next().each(function() { @@ -207,7 +208,7 @@ function toggle(toShow, toHide, data, clickedActive, down) { toHide: toHide, complete: complete, down: down, - autoHeight: options.autoHeight + autoHeight: options.autoHeight || options.fillSpace }; } else { animOptions = { @@ -215,7 +216,7 @@ function toggle(toShow, toHide, data, clickedActive, down) { toHide: toHide, complete: complete, down: down, - autoHeight: options.autoHeight + autoHeight: options.autoHeight || options.fillSpace }; } |