"Image Gallery with Fancybox"
Bootstrap 3.0.3 Snippet by vivianciudad

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<!-- References: https://github.com/fancyapps/fancyBox -->
<link rel="stylesheet" href="//frontend.reklamor.com/fancybox/jquery.fancybox.css" media="screen">
<script src="//frontend.reklamor.com/fancybox/jquery.fancybox.js"></script>
<div class="container">
<div class="row">
<div class='list-group gallery'>
<div class='col-sm-4 col-xs-6 col-md-3 col-lg-3'>
<a class="fancybox thumbnail" rel="ligthbox" href="http://placehold.it/800x600.png">
<img class="img-responsive" alt="" src="http://placehold.it/320x320" />
</a>
</div> <!-- col-6 / end -->
<div class='col-sm-4 col-xs-6 col-md-3 col-lg-3'>
<a class="fancybox thumbnail" rel="ligthbox" href="http://placehold.it/800x600.png">
<img class="img-responsive" alt="" src="http://placehold.it/320x320" />
</a>
</div> <!-- col-6 / end -->
<div class='col-sm-4 col-xs-6 col-md-3 col-lg-3'>
<a class="fancybox thumbnail" rel="ligthbox" href="http://placehold.it/800x600.png">
<img class="img-responsive" alt="" src="http://placehold.it/320x320" />
</a>
</div> <!-- col-6 / end -->
<div class='col-sm-4 col-xs-6 col-md-3 col-lg-3'>
<a class="fancybox thumbnail" rel="ligthbox" href="http://placehold.it/800x600.png">
<img class="img-responsive" alt="" src="http://placehold.it/320x320" />
</a>
</div> <!-- col-6 / end -->
<div class='col-sm-4 col-xs-6 col-md-3 col-lg-3'>
<a class="fancybox thumbnail" rel="ligthbox" href="http://placehold.it/800x600.png">
<img class="img-responsive" alt="" src="http://placehold.it/320x320" />
</a>
</div> <!-- col-6 / end -->
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
.gallery
{
display: inline-block;
margin-top: 20px;
}
.blur {
-webkit-filter: blur(4px)
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$(document).ready(function(){
//FANCYBOX
//https://github.com/fancyapps/fancyBox
$(".fancybox").fancybox({
openEffect: "none",
closeEffect: "none",
padding:0, margin:0,
beforeShow: function () {
$("body *:not(.fancybox-overlay, .fancybox-overlay *)").addClass("blur");
},
afterClose: function () {
$("body *:not(.fancybox-overlay, .fancybox-overlay *)").removeClass("blur");
}
});
});
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Related: See More


Questions / Comments:

Is it possible to make this work with Bootstrap 4?

G33K1E () - 7 years ago - Reply 0