Using multiple modal dialogs in one page

前端 未结 2 958
名媛妹妹
名媛妹妹 2020-12-24 15:43

I have a page where I need to click on links on right hand side and left hand side, and display modal dialogs. I am seeing on bootstrap\'s site that the code for each modal

2条回答
  •  不思量自难忘°
    2020-12-24 16:14

    That depends on how you want to load your dialogs' content.

    If you want them inline, yes, you have to put all the html in the main page. So when user click the link, the content is already there and can be rendered immediately.

    If you want them loaded only when someone clicked the link, you can use iframe inside the modal, or use ajax to load the partial content. check remote section in the modal documentation.

    Or, if you want inline modal but your modals have slightly different content, you can check this http://getbootstrap.com/javascript/#modals-related-target

提交回复
热议问题