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

zindex auto with bootstrap modals #194

Open
redtopia opened this issue Aug 1, 2022 · 1 comment
Open

zindex auto with bootstrap modals #194

redtopia opened this issue Aug 1, 2022 · 1 comment

Comments

@redtopia
Copy link

redtopia commented Aug 1, 2022

I am migrating some dialogs to jBox, but I also have lots of bootstrap modals in my app that will remain for a while. I've got my bootstrap modals always opening on the top, and are jBox aware. However, I'm not sure how to make jBox aware of bootstrap modals. I am currently setting the zIndex option to 'auto', which is great for interacting with other jBox modals.

Would there be a way for me to set the zindex before a jBox modal is open? The trick is to do this every time the modal is open, because if it was closed, and then another modal opened, I would want to update the zindex accordingly.

Thanks!

@StephanWagner
Copy link
Owner

Since the zIndex is set when jBox is created the only option is to override it in the onOpen method: https://jsfiddle.net/StephanWagner/1hsqb9eo/

  new jBox('Modal', {
    onOpen: function() {
      this.wrapper.css({zIndex: 40});
    }
  });

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