Skip to content

Commit 134477d

Browse files
committed
Bump to v2.0.6
1 parent ffe2175 commit 134477d

File tree

10 files changed

+92
-74
lines changed

10 files changed

+92
-74
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
fancyBox - Changelog
22
=========
33

4+
### Version 2.0.6 - April 16, 2012
5+
6+
* Fixed #188 - keystrokes in contenteditable
7+
* Fixed #171 - non-images should not be preloaded
8+
* Fixed #158 - 'closeClick: true' breaks gallery navigation
9+
* New "media" helper - detects and displays various media types
10+
* New option "groupAttr" - name of group selector attribute, default is "data-fancybox-group"
11+
* New feature - selector expressions in URLs, see #170
12+
* Improved 'overlay' helper to use "position: fixed"
13+
* Improved autoSize, fixed wrong height in some cases
14+
* Improved centering and iframe scrolling for iOS
15+
* Updated markup, new element '.fancybox-skin' is now used for styling
16+
417
### Version 2.0.5 - February 21, 2012
518

619
* Fixed #155 - easing for prev/next animations

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,16 @@ May also be passed an optional options object which will extend the default valu
4545
<script>
4646
$(document).ready(function() {
4747
$('.fancybox').fancybox({
48-
padding : 5,
49-
loop : false
48+
padding : 0,
49+
openEffect : 'elastic'
5050
});
5151
});
5252
</script>
5353

54+
Tip: Automatically group and apply fancyBox to all images:
55+
56+
$("a[href$='.jpg'],a[href$='.jpeg'],a[href$='.png'],a[href$='.gif']").attr('rel', 'gallery').fancybox();
57+
5458
Script uses the `href` attribute of the matched elements to obtain the location of the content and to figure out content type you want to display.
5559
You can specify type directly by adding classname (fancybox.image, fancybox.iframe, etc) or `data-fancybox-group` attribute:
5660

@@ -198,7 +202,7 @@ and move them outside of area (use this snippet after including fancybox.css):
198202
In that case, you might want to increase space around box:
199203

200204
$(".fancybox").fancybox({
201-
margin : [20, 60, 20, 60],
205+
margin : [20, 60, 20, 60]
202206
});
203207

204208

demo/iframe.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,12 @@ <h1>fancyBox - iframe demo</h1>
99

1010
<p>
1111
<a href="javascript:parent.jQuery.fancybox.close();">Close iframe parent</a>
12+
13+
|
14+
15+
<a href="javascript:parent.jQuery.fancybox.open({href : '1_b.jpg', title : 'My title'});">Change content</a>
1216
</p>
13-
17+
1418
<p>
1519
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam scelerisque justo ac eros consectetur bibendum. In hac habitasse platea dictumst. Nulla aliquam turpis et tellus elementum luctus. Duis sit amet rhoncus velit. Duis nisl ligula, mattis interdum blandit laoreet, mattis id ante. Cras pulvinar lacus vitae nisi egestas non euismod neque bibendum. Vestibulum faucibus libero id ante molestie ultricies. Vestibulum quis nibh felis. Vestibulum libero nisl, vehicula vel ullamcorper sit amet, tristique sit amet augue. Etiam urna neque, porttitor sed sodales lacinia, posuere a nisl. Vestibulum blandit neque in sapien volutpat ac condimentum sapien auctor. Ut imperdiet venenatis ultricies. Phasellus accumsan, sem eu placerat commodo, felis purus commodo ipsum, sit amet vulputate orci est viverra est.
1620
</p>

demo/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
66

77
<!-- Add jQuery library -->
8-
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
8+
<script type="text/javascript" src="../lib/jquery-1.7.2.min.js"></script>
99

1010
<!-- Add mousewheel plugin (this is optional) -->
1111
<script type="text/javascript" src="../lib/jquery.mousewheel-3.0.6.pack.js"></script>
1212

1313
<!-- Add fancyBox main JS and CSS files -->
14-
<script type="text/javascript" src="../source/jquery.fancybox.js"></script>
15-
<link rel="stylesheet" type="text/css" href="../source/jquery.fancybox.css" media="screen" />
14+
<script type="text/javascript" src="../source/jquery.fancybox.js?v=2.0.6"></script>
15+
<link rel="stylesheet" type="text/css" href="../source/jquery.fancybox.css?v=2.0.6" media="screen" />
1616

1717
<!-- Add Button helper (this is optional) -->
1818
<link rel="stylesheet" type="text/css" href="../source/helpers/jquery.fancybox-buttons.css?v=1.0.2" />
@@ -201,7 +201,7 @@
201201
});
202202
</script>
203203
<style type="text/css">
204-
.fancybox-custom .fancybox-outer {
204+
.fancybox-custom .fancybox-skin {
205205
box-shadow: 0 0 50px #222;
206206
}
207207
</style>

source/helpers/jquery.fancybox-buttons.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
position: fixed;
33
left: 0;
44
width: 100%;
5-
z-index: 1005;
5+
z-index: 8050;
66
}
77

88
#fancybox-buttons.top {

source/helpers/jquery.fancybox-media.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
rez;
4444

4545
if ((rez = href.match(/(youtube\.com|youtu\.be)\/(v\/|u\/|embed\/|watch\?v=)?([^#\&\?]*).*/i))) {
46-
href = '//www.youtube.com/embed/' + rez[3] + '?autoplay=1&fs=1&rel=0&modestbranding=1&enablejsapi=1';
46+
href = '//www.youtube.com/embed/' + rez[3] + '?autoplay=1&autohide=1&fs=1&rel=0&enablejsapi=1';
4747
type = 'iframe';
4848

4949
} else if ((rez = href.match(/vimeo.com\/(\d+)\/?(.*)/))) {
@@ -78,7 +78,6 @@
7878
if (type) {
7979
obj.href = href;
8080
obj.type = type;
81-
obj.autoSize = false;
8281
}
8382
}
8483
}

source/helpers/jquery.fancybox-thumbs.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#fancybox-thumbs {
22
position: fixed;
3-
left: 0px;
3+
left: 0;
44
width: 100%;
55
overflow: hidden;
6-
z-index: 1005;
6+
z-index: 8050;
77
}
88

99
#fancybox-thumbs.bottom {

source/jquery.fancybox.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! fancyBox v2.0.5 fancyapps.com | fancyapps.com/fancybox/#license */
1+
/*! fancyBox v2.0.6 fancyapps.com | fancyapps.com/fancybox/#license */
22
.fancybox-tmp iframe, .fancybox-tmp object {
33
vertical-align: top;
44
padding: 0;

source/jquery.fancybox.js

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
22
* fancyBox - jQuery Plugin
3-
* version: 2.0.5 (14/04/2012)
3+
* version: 2.0.6 (16/04/2012)
44
* @requires jQuery v1.6 or later
55
*
66
* Examples at http://fancyapps.com/fancybox/
@@ -18,10 +18,10 @@
1818
F = $.fancybox = function () {
1919
F.open.apply( this, arguments );
2020
},
21-
didResize = false,
22-
resizeTimer = null,
23-
isTouch = document.createTouch !== undefined,
24-
isString = function(str) {
21+
didResize = false,
22+
resizeTimer = null,
23+
isTouch = document.createTouch !== undefined,
24+
isString = function(str) {
2525
return $.type(str) === "string";
2626
},
2727
isPercentage = function(str) {
@@ -59,7 +59,7 @@
5959

6060
fixed: false,
6161
scrolling: 'auto', // 'auto', 'yes' or 'no'
62-
wrapCSS: 'fancybox-default',
62+
wrapCSS: '',
6363

6464
arrows: true,
6565
closeBtn: true,
@@ -486,8 +486,8 @@
486486
}
487487
},
488488

489-
trigger: function (event, obj) {
490-
var ret, obj = obj || F[ $.inArray(event, ['onCancel', 'beforeLoad', 'afterLoad']) > -1 ? 'coming' : 'current' ];
489+
trigger: function (event, o) {
490+
var ret, obj = o || F[ $.inArray(event, ['onCancel', 'beforeLoad', 'afterLoad']) > -1 ? 'coming' : 'current' ];
491491

492492
if (!obj) {
493493
return;
@@ -675,7 +675,9 @@
675675
$.extend(F.coming, {
676676
type : 'html',
677677
autoSize : true,
678+
minWidth : 0,
678679
minHeight : 0,
680+
padding : 15,
679681
hasError : type,
680682
content : F.coming.tpl.error
681683
});
@@ -930,17 +932,17 @@
930932
},
931933

932934
_setDimension: function () {
933-
var wrap = F.wrap,
934-
inner = F.inner,
935-
current = F.current,
936-
viewport = F.getViewport(),
937-
margin = current.margin,
938-
padding2 = current.padding * 2,
939-
width = current.width,
940-
height = current.height,
941-
maxWidth = current.maxWidth + padding2,
935+
var wrap = F.wrap,
936+
inner = F.inner,
937+
current = F.current,
938+
viewport = F.getViewport(),
939+
margin = current.margin,
940+
padding2 = current.padding * 2,
941+
width = current.width,
942+
height = current.height,
943+
maxWidth = current.maxWidth + padding2,
942944
maxHeight = current.maxHeight + padding2,
943-
minWidth = current.minWidth + padding2,
945+
minWidth = current.minWidth + padding2,
944946
minHeight = current.minHeight + padding2,
945947
ratio,
946948
height_;
@@ -961,7 +963,7 @@
961963
height += padding2;
962964

963965
if (current.fitToView) {
964-
maxWidth = Math.min(viewport.w, maxWidth);
966+
maxWidth = Math.min(viewport.w, maxWidth);
965967
maxHeight = Math.min(viewport.h, maxHeight);
966968
}
967969

@@ -1239,9 +1241,9 @@
12391241
.show()
12401242
.animate(endPos, {
12411243
duration : effect === 'none' ? 0 : current.openSpeed,
1242-
easing : current.openEasing,
1243-
step: elastic ? this.step : null,
1244-
complete: F._afterZoomIn
1244+
easing : current.openEasing,
1245+
step : elastic ? this.step : null,
1246+
complete : F._afterZoomIn
12451247
});
12461248
},
12471249

@@ -1265,10 +1267,10 @@
12651267
}
12661268

12671269
wrap.animate(endPos, {
1268-
duration: effect === 'none' ? 0 : current.closeSpeed,
1269-
easing: current.closeEasing,
1270-
step: elastic ? this.step : null,
1271-
complete: F._afterZoomOut
1270+
duration : effect === 'none' ? 0 : current.closeSpeed,
1271+
easing : current.closeEasing,
1272+
step : elastic ? this.step : null,
1273+
complete : F._afterZoomOut
12721274
});
12731275
},
12741276

@@ -1291,11 +1293,8 @@
12911293
.show()
12921294
.animate(endPos, {
12931295
duration : effect === 'none' ? 0 : current.nextSpeed,
1294-
easing : current.nextEasing,
1295-
complete: function() {
1296-
//Somehow this helps to restore overflow
1297-
setTimeout( F._afterZoomIn, 1);
1298-
}
1296+
easing : current.nextEasing,
1297+
complete : F._afterZoomIn
12991298
});
13001299
},
13011300

@@ -1315,9 +1314,9 @@
13151314
}
13161315

13171316
wrap.animate(endPos, {
1318-
duration: effect === 'none' ? 0 : current.prevSpeed,
1319-
easing: current.prevEasing,
1320-
complete: cleanUp
1317+
duration : effect === 'none' ? 0 : current.prevSpeed,
1318+
easing : current.prevEasing,
1319+
complete : cleanUp
13211320
});
13221321
}
13231322
};

0 commit comments

Comments
 (0)