views:

572

answers:

2

I'm using the JQUERY UI Accordion module:

<script type="text/javascript">
$(function() {
    $("#sidebar_column_accordion").accordion({
        fillSpace: true,
        icons: { 'header': 'ui-icon-plus', 'headerSelected': 'ui-icon-minus' }
    });
});
</script>

By using the fillSpace option, the accordion takes up the entire height of the window which I want. Problem is it calculate the height on page load, and if the user resizes their browser, it does not adjust...

Is there a way to have the accordion recalculate the height/size when the browser window is resized?

Thanks

+1  A: 
$(window).resize(function(){
    $("#sidebar_column_accordion").accordion("resize");
});
PetersenDidIt
That seems way to easy! I'll try that tonight and get back. thxs
AnApprentice
Did you find this on a doc somewhere? I can't find this anywhere?
AnApprentice
Doesn't look like the docs have it shown but the demo source shows the user of the resize method for the accordion. http://jqueryui.com/demos/accordion/#fillspace
PetersenDidIt
Thanks that worked incredibly. It's to bad they don't have that in the docs!
AnApprentice
Thanks, ticket filed http://dev.jqueryui.com/ticket/5336
RedWolves
A: 

Is there a way to attach a function to the resize event for the accordion

nabbed
Yes, bing to use window.resize
AnApprentice