I have looked for a while, but I can't find a solution for this. I want the following:
- Open an URL inside a Bootstrap modal. I have this working off course. So the content is loaded dynamically.
- When an user pushes a button inside this modal, I want the current modal to hide, and immediately after that, I want a new modal to open with the new URL (which the user clicked on). This content of the 2nd modal is also loaded dynamically.
- If the user then closes that 2nd modal, the first modal must come back again.
I have been staring at this for days, hope someone can help me.
Thanks in advance.
In first modal:
replace modal dismiss link in footer with close link below.
In second modal:
Then second modal replace top div with below div tag.
Try this
I had the same issue as @Gravity Grave whereby scrolling doesn't work if you use
in conjunction with
The scroll doesn't work correctly and reverts to scrolling the page rather than the modal. This is due to data-dismiss removing the modal-open class from the tag.
My solution in the end was to set the html of the inner component on the modal and use css to fade the text in/out.
Problem with
data-dismiss="modal"
is it will shift your content to leftI am sharing what worked for me, problem statment was opening
pop1
frompop2
JS CODE
Had the same issue, writing this here in case someone in the future stumbles upon this and has issues with multiple modals that have to have scrolling as well (I'm using Bootstrap 3.3.7)
What I did is have a button like this inside my first modal:
It will hide the first and then display the second, and in the second modal I would have a close button that would look like this:
So this will close the second modal and open up the first one and to make scrolling work I added to my .css file this line:
PS: Just a side note, you have to have these modals separately, the minor modal can not be nested in the first one as you hide the first one
So here's the full example based on the bootstrap modal example: