Open a Modal from another modal and close the first (launching) modal

后端 未结 6 2141
陌清茗
陌清茗 2020-12-24 09:42

I\'m using Bootstrap Modal Window plugin its work fine but i would like to open another model window when i click next and close first one. how can i do it?

         


        
6条回答
  •  死守一世寂寞
    2020-12-24 09:55

    All right everybody, stand back; I've got this.

    This method negates both the padding & scrolling issues present in other methods (see bottom) and is [IMO] the cleanest way to achieve the required functionality using Bootstrap Modals.

    Inline

    Open Modal
    

    Full Fat:

    
    
    Open Modal
    

    Beastmode:

    
    
    Open Modal
    

    Tip: Unless you need to do this more than once, I recommend using the Inline version.


    Issues present in other answers

    It creates a problem, when your modal has more height than your screen. As data-dismiss="modal" removes modal-open class from body tag. so, when you scroll, modal doesn't scrolls, but the faded background starts moving. which is bad. // Deepak Yadav

    Can confirm the issue reported by @Deepak. Furthermore the page will increment and enforce "padding-right" by +17px each time you open a modal from inside another (modal might need to be taller than the page for this to happen). This holds true for almost all methods on this page. See my answer for a method that avoids these issues. // Matthew Hudson

提交回复
热议问题