Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Containers #5

Closed
Looky1173 opened this issue Apr 30, 2021 · 2 comments
Closed

Dynamic Containers #5

Looky1173 opened this issue Apr 30, 2021 · 2 comments

Comments

@Looky1173
Copy link

Hello,

I tried to use this library inside a dynamic container that shares the page with a sidebar. When the sidebar is collapsed, the dimensions of this container change accordingly. Unfortunately, I couldn't get this to work as the dimensions of the parent container are dynamic. Is there a way to fix this?

Thank you for your response in advance!

@Tom-Rawlings
Copy link
Owner

I've updated the code to add a function that resizes the main parent container.

I've also made a branch with a demo page showing how you can get it working with a sidebar. You basically need to have your sidebar as a separate

from the main resizable parent, then call Resizable.parentResize(window.innerWidth - sidebarWidth, window.innerHeight); to resize the content when it's opened. You then also need to shift everything over with document.getElementById("main").style.left = sidebarWidth + 'px'; and of course do the opposite when the sidebar is closed.
This is assuming your sidebar in on the left and the parent of your resizable content has the id of 'main'

https://github.com/Tom-Rawlings/Resizable.js/tree/Sidebar-Demo

Hope this helps

@Looky1173
Copy link
Author

Thank you for your reply, it helps!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants