0

For sake of simplicity, my site has two floated DIV blocks. #Sidebar and #Content. In my sidebar, I have a jQuery Vertical Accordion Menu, which expands. (Duh, it's an Accordion Menu)

Anyhow, when a user clicks on one of the submenu headers, it expands the menu and forces its containing DIV to expand as well.

I'm looking for a way, using jQuery, to expand #Content to the same size as #Sidebar, as #Sidebar is expanding. Is this possible?

I have tried the normal way to make both DIV's the same size, but it does so when the page loads, not dynamically.

Thanks for any help! Rick

4

1 回答 1

0

You can bind to the accordionchange event a function like so:

$("#Sidebar").bind('accordionchange', function () {
    $("#Content").height($("#Sidebar").height());
});

That should set the heights to be equal when the animation completes.

EDIT: You may also bind it in the accordion initializer by setting the change: field to your function to run when the accordion has changed

于 2012-05-08T03:43:42.707 回答