Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap: Open Another Modal in Modal

So, I'm using this code to open another modal window in a current opened modal window:

<a onclick=\"$('#login').modal('hide');$('#lost').modal('show');\" href='#'>Click</a> 

What happens is, that for like 500ms the scrollbar will duplicate. I guess because the current modal is still fading out. However it looks very un-smooth and stuttering.

I would appreciate any suggestions to solve this issue.

Also, is the way building this in an onclick-event unprofessional?

I'm working with the bootstrap version 3.0.

Edit: I guess it's neccesary to reduce the time of fading out a modal. How is this possible?

like image 793
AlexioVay Avatar asked Oct 22 '13 20:10

AlexioVay


People also ask

How do I open another modal in modal?

To open a modal from another modal can be done simply by using the events that Bootstrap provides such as show. bs. modal . You may also want some CSS to handle the backdrop overlays.

Can we open modal within a modal?

To open another modal in modal with Bootstrap, we can set the z-index of the modals. to add the modals. so the 2nd modal will show on top of the first one.

How do you show a modal pop up above other modal pop up?

Try setting the z-index of the popup wrapper you want above greater than the other.. This is provided that #popup1 and #popup2 have the same parent. Show activity on this post. set the z-index of popup which should be on the top, highest than any other element on the DOM.


1 Answers

data-dismiss makes the current modal window force close

data-toggle opens up a new modal with the href content inside it

<a data-dismiss="modal" data-toggle="modal" href="#lost">Click</a> 

or

<a data-dismiss="modal" onclick="call the new div here">Click</a> 

do let us know if it works.

  • You might also want to take a look around the Modal Documentation
like image 154
jayeshkv Avatar answered Oct 20 '22 01:10

jayeshkv