0
我正在用twitter bootstrap modal进行一些修改,我正试图在模态窗口中实现动态图像加载。另外,当加载某个图像时,我希望能够在图像之间滑动。任何人都可以帮我解决这个问题吗?在bootstrap 2.3 modal中动态加载内容
这里是结构:
<!-- Image trigger -->
<div class="item">
<a data-toggle="modal" href="#myModal" class="modal-trigger">
<img src="img/7.jpg" alt="">
</a>
</div>
<!-- Modal window -->
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<!-- it makes empty spaces clickable -->
<div type="button" class="close" data-dismiss="modal" aria-hidden="true"> </div>
<img data-dismiss="modal" aria-hidden="true" src="http://placehold.it/800x670" class="image" alt="" data-target="#myModal"></div>
这里是刷卡功能的javascript:
$(document).ready(function() {
// Swipe feature
$("#myCarousel").swiperight(function() {
$("#myCarousel").carousel('prev');
});
$("#myCarousel").swipeleft(function() {
$("#myCarousel").carousel('next');
});
模式中的html应该如何显示? 现在它像上面的例子一样加载静态图像。 – 2014-10-08 10:38:17
yourApp.loadModalContent可以从AJAX调用(将是最好的)或从DOM节点返回html(不是一种好的做法) – redaxmedia 2014-10-08 10:39:30
不幸的是它不起作用。我刚刚将您的代码添加到我上面提到的示例中,但仍然发生任何事情。在模态窗口中,我已经移除了静态图像加载,并使用了src =“”来填充ajax空间。 – 2014-10-08 10:45:10