I've met some problems when I try to use Bootstrap Modal
in my code.
HTML:
<a href="http://another.page" data-toggle="modal">Another Page</a>
or
<a href="http://another.page" data-toggle="modal" data-target="#myModal">Another Page</a>
I'd like to modal another.page
to my page, but it doesn't work.
the another.page
is looks like:
<html>
<body>
<div id="myModal" class="tm-modal hide fade" tabindex="-1" role="dialog" aria- labelledby="myModalLabel" aria-hidden="true">
<div class="tm-modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"> </button>
<h6>Modal Heading</h6>
</div>
<div class="tm-modal-body">
<p>One fine body
<85>
</p>
</div>
<div class="tm-modal-footer">
<button class="tm-btn" data-dismiss="modal" aria-hidden="true">Close</button>
<button class="tm-btn tm-btn-recommand">Save changes</button>
</div>
</div>
</body>
</html>
I don't want to load the another.page
as a <div>
in my code, because there are too many place that I need to use modal.
Did I missed something important?
Thank you very much.
Do you want from the page 1 open the page 2 and than open the modal inside this second page? if yes, here is a solution:
At the first page you'll use:
At the second page you'll insert your modal and the follow script:
Make use of the element div
and make script
and change
this is other solution good luck
Make use of the element
iframe
And maybe you want to style it
http://jsfiddle.net/u29Tj/3/
Just to be clear, that you read the manual, based on your comments:
Look at the
data-target
attribute of your link: It is an anchor to theHTML Element
Modal Window
. You need this for Boostrap to show and hide the window. You should not linking it to your page. You need to link it to your Modal! In the Modal Body you use the Iframe.Alternative
Homework for you:
data-iframemodal
Attribute you want to have a Iframe.data-iframemodel
: