bootstrap dismiss modal and display another modal

DevStacker

Having a bit of a problem with using Bootstraps modal,

I have a login form which uses a modal (when pressed the login form will appear)

If the user does not have an account, they can press "sign up" I would like the login modal to be dismissed and the sign up modal to appear

I have this working, the login form is dismissed when sign up is clicked, but when the sign up modal is shown, you cannot scroll up or down on the sign up modal, (you can scroll up or down on the login modal)

sorry for the long explanation, the jsfiddle below is my code,

<p> Don't have an account? <a data-dismiss="modal" data-toggle="modal" data-target="#myModal1"> Sign up</a>

This is the code which dismisses the login modal and shows the sign up modal. I know that the modal is dismissed via data-dismiss="modal" (so the page thinks the modal is closed and scrolls through the web page) however I do not know how to find a way around this.

http://jsfiddle.net/5v4nejsz/

The lorem ipsum is there to show the example of the scrolling.

The first form is the login modal and the second form is the sign up

Thank you for the help!

Bruno Henrique

I succeeded with the following. I created a class with attribute overflow: hidden. Anytime the myModal1 opens, it's added to the body.

$("#button").click(function(){
    $('#myModal').modal("hide");   
    $('#myModal1').modal("toggle");
    $("body").addClass("notScroll");

});

When myModal1 closes, the class is removed:

$('#myModal1').on('hidden.bs.modal', function () {
    $("body").removeClass("notScroll");
});

Now, you have to allow myModal1 to scroll:

<modal... id="myModal1" style="overflow-y: scroll">

JSFIDDLE: http://jsfiddle.net/5v4nejsz/22/

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Bootstrap modal on another modal

From Dev

Bootstrap Modal validation displaying on dismiss

From Dev

Bootstrap Modal validation displaying on dismiss

From Dev

Bootstrap: Open Another Modal in Modal

From Dev

Display and dismiss a modal view controller in Swift

From Dev

AngularJS Bootstrap Modal $modalInstance.dismiss is not a function

From Dev

Call function defined in modal on ui-bootstrap modal dismiss

From Dev

Data-Dismiss: How to dismiss bootstrap modal inside function

From Dev

Data-Dismiss: How to dismiss bootstrap modal inside function

From Dev

angularjs - Accessing ui-bootstrap modal dismiss and close function from another controller

From Dev

Rails display bootstrap modal of index from another model

From Dev

How to display a react-bootstrap modal from another component

From Dev

Bootstrap 3 - open modal from another modal

From Dev

Twitter bootstrap show modal from by another modal

From Dev

How to display an Alert in Bootstrap Modal

From Dev

display a bootstrap modal if checkbox is checked

From Dev

failing to display bootstrap UI Modal

From Dev

Display This Bootstrap Modal on Page Load

From Dev

Bootstrap Modal from another page

From Dev

Bootstrap Modal from another page

From Dev

dismiss modal ViewControllers

From Dev

Dismiss modal segue

From Dev

Dismiss modal on Apple Watch

From Dev

Dismiss a Modal UINavigation Controller

From Dev

Simplest way to dismiss Bootstrap alerts when the containing modal is dismissed

From Dev

How to dismiss a web modal dialog from bootstrap manually?

From Dev

Can't dismiss custom UI Bootstrap modal by backdrop click

From Dev

Bootstrap modal data-dismiss button is posting the form

From Dev

bootstrap modal inside a modal

Related Related

  1. 1

    Bootstrap modal on another modal

  2. 2

    Bootstrap Modal validation displaying on dismiss

  3. 3

    Bootstrap Modal validation displaying on dismiss

  4. 4

    Bootstrap: Open Another Modal in Modal

  5. 5

    Display and dismiss a modal view controller in Swift

  6. 6

    AngularJS Bootstrap Modal $modalInstance.dismiss is not a function

  7. 7

    Call function defined in modal on ui-bootstrap modal dismiss

  8. 8

    Data-Dismiss: How to dismiss bootstrap modal inside function

  9. 9

    Data-Dismiss: How to dismiss bootstrap modal inside function

  10. 10

    angularjs - Accessing ui-bootstrap modal dismiss and close function from another controller

  11. 11

    Rails display bootstrap modal of index from another model

  12. 12

    How to display a react-bootstrap modal from another component

  13. 13

    Bootstrap 3 - open modal from another modal

  14. 14

    Twitter bootstrap show modal from by another modal

  15. 15

    How to display an Alert in Bootstrap Modal

  16. 16

    display a bootstrap modal if checkbox is checked

  17. 17

    failing to display bootstrap UI Modal

  18. 18

    Display This Bootstrap Modal on Page Load

  19. 19

    Bootstrap Modal from another page

  20. 20

    Bootstrap Modal from another page

  21. 21

    dismiss modal ViewControllers

  22. 22

    Dismiss modal segue

  23. 23

    Dismiss modal on Apple Watch

  24. 24

    Dismiss a Modal UINavigation Controller

  25. 25

    Simplest way to dismiss Bootstrap alerts when the containing modal is dismissed

  26. 26

    How to dismiss a web modal dialog from bootstrap manually?

  27. 27

    Can't dismiss custom UI Bootstrap modal by backdrop click

  28. 28

    Bootstrap modal data-dismiss button is posting the form

  29. 29

    bootstrap modal inside a modal

HotTag

Archive