You could use the UI Layout plug-in. It utilizes a fixed-size 'container' with 2 or more sub-elements. When you drag the resizer/ splitter between two pane-divs, *both* divs are resized, so the combined width and height is always constant. There are many options available, like min/max-max sizes, live sizing, state-managment (remembers sizes), etc.
website: http://layout.jquery-dev.net/download.html demos: http://layout.jquery-dev.net/demos.html forum: http://groups.google.com/group/jquery-ui-layout/topics If you wish to use it, I suggest using the latest release-candidate instead of version 1.2.0... http://layout.jquery-dev.net/lib/js/jquery.layout-latest.js This has a lot of new features, and will become version 1.3.0 final in a few days. If you choose to make your own plug-in instead, you could still use the same concept of having a fixed-size container with 2 sub-elements inside, and a 'splitter' element between them. Then use ui-draggable to make the spliltter draggable and resize the 2 sub-elements on drag.stop. /Kevin On Oct 4, 6:59 pm, russgum <[email protected]> wrote: > I would like to create a plugin similar to the alsoResize plugin > except that the with of the second object is reduced when the width of > the first object is increased. Specifically, if both objects start out > at 500px in width I want to restrict the total width of both objects > to 1000px. If one is dragged to 600px the other would shrink to 400px. > If one is dragged to 300px the other would increase to 700px. > > My problem is that I am a rookie at javascript and don't understand > how to modify the code in alsoResize to do what I want. Any > suggestions as to how to do this would be greatly appreciated. > > Thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery UI" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jquery-ui?hl=en -~----------~----~----~----~------~----~------~--~---
