0
我有很多图片必须与bootstrap模态一起制作。与JS一起工作的功能现在正常,但我想优化代码。这是HTML代码。包含外部模态html文件
HTML
<img id="courseImage" src="/images/thumbs/image1.jpg" alt="Trolltunga, Norway" width="300" height="200">
<!-- The Modal -->
<div id="courseModal" class="modal">
<!-- The Close Button -->
<span class="close" onclick="document.getElementById('courseModal').style.display='none'">×</span>
<!-- Modal Content (The Image) -->
<img class="modal-content" id="img01">
<!-- Modal Caption (Image Text) -->
<div id="caption"></div>
</div>
请问有没有办法,在那里我可以包括一些HTML的。我试图这样做,但这不起作用。
<img id="courseImage" src="/images/thumbs/image1.jpg" alt="Trolltunga, Norway" width="300" height="200">
<?php include $_SERVER['DOCUMENT_ROOT'] . '/resources/includes/courseModal.html' ?>
我只是想,如果我必须设置为100左右画面的HTML,有要去的HTML代码有很多很多的一个文件内。每张照片需要6行代码。
对于模式..您可以移动到emodal.js或bootbox.js http://saribe.github.io/eModal/#demo http://bootboxjs.com/examples.html –