3
我使用Fancybox v2.1.5-0并尝试绑定另一个div的内容。如何绑定fancybox内容形成另一个div内容?
内容图像已经在HTML页面的另一个div中。
这里我的HTML代码:
Bootstrap 3 carousel
---------------------------------------------------------------
<div class="hotelsd-img">
<div id="photoCarousel-1" class="carousel slide" data-ride="carousel">
<div class="carousel-inner" role="listbox">
<div class="item active">
<img class="img-responsive" src="http:\\www.confirmedrooms.com\hotelbooking\images\hotelimages\1110\031742.jpg" alt="Hotel Name">
</div>
<div class="item active">
<img class="img-responsive" src="http:\\www.confirmedrooms.com\hotelbooking\images\hotelimages\1110\031742.jpg" alt="Hotel Name">
</div>
<div class="item active">
<img class="img-responsive" src="http:\\www.confirmedrooms.com\hotelbooking\images\hotelimages\1110\031742.jpg" alt="Hotel Name">
</div>
</div>
</div>
</div>
Photo Count
--------------------------------------------------------
<div id="hotelGallery-1" class="photoCount">
<a href="#" class="openGallery">View all 15 Photos</a>
</div>
现在,我想开画廊的fancybox上openGallery click事件。
我有包括头的fancybox文件:
<script src="js/jquery.min.js"></script>
<link rel="stylesheet" href="js/plugins/fancybox/jquery.fancybox.css">
<script src="js/plugins/fancybox/jquery.fancybox.pack.js"></script>
JS代码,我尝试这样的:
$('.openGallery').on('click',function(){
$.fancybox({
// Possible code here
});
});
所以,如何从项目格复制内容和推入的fancybox内容和开放。帮我建立这个。
我觉得你没没有问题,OP想要一个Fancybox画廊,而不是整个图像在一个fancybox – JFK
@JFK,我实际上错过了这条线'现在,我想打开Fancybox画廊openGallery点击事件.'感谢指出 – Shehary
@JFK由w唉,你总是先拍,然后问问题:P – Shehary