Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>so @Ashish says change the content of your modal before you show it, see <a href="http://jsfiddle.net/qV2CU/" rel="nofollow">http://jsfiddle.net/qV2CU/</a></p> <p><strong>html</strong></p> <pre class="lang-html prettyprint-override"><code>&lt;div class="container"&gt; &lt;div class="row"&gt; &lt;div class="col-sm-4"&gt;&lt;button id="showvideo"&gt;Video&lt;/button&gt;&lt;/div&gt; &lt;div class="col-sm-4"&gt;&lt;button id="showtext"&gt;Text&lt;/button&gt;&lt;/div&gt; &lt;div class="col-sm-4"&gt;&lt;button id="showimage"&gt;Image&lt;/button&gt;&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- Modal --&gt; &lt;div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt; &lt;div class="modal-dialog"&gt; &lt;div class="modal-content"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt; &lt;h4 class="modal-title"&gt;Modal title&lt;/h4&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt; &lt;button type="button" class="btn btn-primary"&gt;Save changes&lt;/button&gt; &lt;/div&gt; &lt;/div&gt;&lt;!-- /.modal-content --&gt; &lt;/div&gt;&lt;!-- /.modal-div --&gt; </code></pre> <p><strong>javascript</strong></p> <pre class="lang-js prettyprint-override"><code>$('#showvideo').click(function(){ $('#myModal .modal-title').html('Video'); $('#myModal .modal-body').html('&lt;iframe width="100%" height="315" src="//www.youtube.com/embed/_Wo9JxLIQYg" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;'); $('#myModal').modal('show'); }); $('#showtext').click(function(){ $('#myModal .modal-title').html('Text'); $('#myModal .modal-body').html('Praesent vitae lorem lectus. Praesent ut lectus id ipsum cursus rutrum sit amet eu elit. In accumsan pulvinar nisl euismod condimentum. Integer consequat, velit rhoncus vestibulum vehicula, turpis dolor euismod velit, eu volutpat eros ligula non ligula. Quisque non cursus nulla, eu viverra sem. Mauris dapibus id nulla at venenatis. Etiam viverra massa eu sem rhoncus commodo. Praesent at iaculis nulla. Aliquam feugiat neque dui, vitae condimentum massa accumsan sollicitudin. Integer pellentesque tempor augue, a euismod nunc posuere a. Mauris vulputate ante a lectus consectetur mattis. Donec tincidunt dictum vestibulum. '); $('#myModal').modal('show') }); $('#showimage').click(function(){ $('#myModal .modal-title').html('Image'); $('#myModal .modal-body').html('&lt;img src="http://dummyimage.com/300x150/000/ff"&gt;'); $('#myModal').modal('show') }); $('#myModal').on('hidden.bs.modal', function () { //See: http://stackoverflow.com/questions/13799377/twitter-bootstrap-modal-stop-youtube-video //let the movie stop $('#myModal .modal-body').html(''); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload