简体   繁体   中英

Bootstrap modal new page

I want to make a modal where in if I click the button the modal pops up and the content of the modal is from a different page. Please help me.

This is my code

 <a href="#" class="btn btn-lg btn-success" data-toggle="modal" data-target="#basicModal">Click to open Modal</a> <div class="modal fade" id="basicModal" tabindex="-1" role="dialog" aria-labelledby="basicModal" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button> <h4 class="modal-title" id="myModalLabel">Basic Modal</h4> </div> <div class="modal-body"> <h3>Modal Body</h3> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary">Save changes</button> </div> </div> </div> </div>

I want to know what Javascript? and where exactly should I put it? I'm using bootstrap v 3.03 by the way.

I think this is what you're looking for.
You need to pay special attention to this line in particular:

<a data-toggle="modal" class="btn btn-info" href="remote.html" data-target="#myModal">Click me !</a>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM