2 * FancyBox - jQuery Plugin
3 * Simple and fancy lightbox alternative
5 * Examples and documentation at: http://fancybox.net
7 * Copyright (c) 2008 - 2010 Janis Skarnelis
8 * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated.
10 * Version: 1.3.4 (11/11/2010)
11 * Requires: jQuery v1.3+
13 * Dual licensed under the MIT and GPL licenses:
14 * http://www.opensource.org/licenses/mit-license.php
15 * http://www.gnu.org/licenses/gpl.html
19 var tmp, loading, overlay, wrap, outer, content, close, title, nav_left, nav_right,
21 selectedIndex = 0, selectedOpts = {}, selectedArray = [], currentIndex = 0, currentOpts = {}, currentArray = [],
23 ajaxLoader = null, imgPreloader = new Image(), imgRegExp = /\.(jpg|gif|png|bmp|jpeg)(.*)?$/i, swfRegExp = /[^\.]\.(swf)\s*$/i,
25 loadingTimer, loadingFrame = 1,
27 titleHeight = 0, titleStr = '', start_pos, final_pos, busy = false, fx = $.extend($('<div/>')[0], { prop: 0 }),
29 isIE6 = $.browser.msie && $.browser.version < 7 && !window.XMLHttpRequest,
38 imgPreloader.onerror = imgPreloader.onload = null;
48 if (false === selectedOpts.onError(selectedArray, selectedIndex, selectedOpts)) {
54 selectedOpts.titleShow = false;
56 selectedOpts.width = 'auto';
57 selectedOpts.height = 'auto';
59 tmp.html( '<p id="fancybox-error">The requested content cannot be loaded.<br />Please try again later.</p>' );
65 var obj = selectedArray[ selectedIndex ],
75 selectedOpts = $.extend({}, $.fn.fancybox.defaults, (typeof $(obj).data('fancybox') == 'undefined' ? selectedOpts : $(obj).data('fancybox')));
77 ret = selectedOpts.onStart(selectedArray, selectedIndex, selectedOpts);
82 } else if (typeof ret == 'object') {
83 selectedOpts = $.extend(selectedOpts, ret);
86 title = selectedOpts.title || (obj.nodeName ? $(obj).attr('title') : obj.title) || '';
88 if (obj.nodeName && !selectedOpts.orig) {
89 selectedOpts.orig = $(obj).children("img:first").length ? $(obj).children("img:first") : $(obj);
92 if (title === '' && selectedOpts.orig && selectedOpts.titleFromAlt) {
93 title = selectedOpts.orig.attr('alt');
96 href = selectedOpts.href || (obj.nodeName ? $(obj).attr('href') : obj.href) || null;
98 if ((/^(?:javascript)/i).test(href) || href == '#') {
102 if (selectedOpts.type) {
103 type = selectedOpts.type;
106 href = selectedOpts.content;
109 } else if (selectedOpts.content) {
113 if (href.match(imgRegExp)) {
116 } else if (href.match(swfRegExp)) {
119 } else if ($(obj).hasClass("iframe")) {
122 } else if (href.indexOf("#") === 0) {
135 if (type == 'inline') {
136 obj = href.substr(href.indexOf("#"));
137 type = $(obj).length > 0 ? 'inline' : 'ajax';
140 selectedOpts.type = type;
141 selectedOpts.href = href;
142 selectedOpts.title = title;
144 if (selectedOpts.autoDimensions) {
145 if (selectedOpts.type == 'html' || selectedOpts.type == 'inline' || selectedOpts.type == 'ajax') {
146 selectedOpts.width = 'auto';
147 selectedOpts.height = 'auto';
149 selectedOpts.autoDimensions = false;
153 if (selectedOpts.modal) {
154 selectedOpts.overlayShow = true;
155 selectedOpts.hideOnOverlayClick = false;
156 selectedOpts.hideOnContentClick = false;
157 selectedOpts.enableEscapeButton = false;
158 selectedOpts.showCloseButton = false;
161 selectedOpts.padding = parseInt(selectedOpts.padding, 10);
162 selectedOpts.margin = parseInt(selectedOpts.margin, 10);
164 tmp.css('padding', (selectedOpts.padding + selectedOpts.margin));
166 $('.fancybox-inline-tmp').unbind('fancybox-cancel').bind('fancybox-change', function() {
167 $(this).replaceWith(content.children());
172 tmp.html( selectedOpts.content );
177 if ( $(obj).parent().is('#fancybox-content') === true) {
182 $('<div class="fancybox-inline-tmp" />')
184 .insertBefore( $(obj) )
185 .bind('fancybox-cleanup', function() {
186 $(this).replaceWith(content.children());
187 }).bind('fancybox-cancel', function() {
188 $(this).replaceWith(tmp.children());
191 $(obj).appendTo(tmp);
199 $.fancybox.showActivity();
201 imgPreloader = new Image();
203 imgPreloader.onerror = function() {
207 imgPreloader.onload = function() {
210 imgPreloader.onerror = imgPreloader.onload = null;
215 imgPreloader.src = href;
219 selectedOpts.scrolling = 'no';
221 str = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"><param name="movie" value="' + href + '"></param>';
224 $.each(selectedOpts.swf, function(name, val) {
225 str += '<param name="' + name + '" value="' + val + '"></param>';
226 emb += ' ' + name + '="' + val + '"';
229 str += '<embed src="' + href + '" type="application/x-shockwave-flash" width="' + selectedOpts.width + '" height="' + selectedOpts.height + '"' + emb + '></embed></object>';
239 $.fancybox.showActivity();
241 selectedOpts.ajax.win = selectedOpts.ajax.success;
243 ajaxLoader = $.ajax($.extend({}, selectedOpts.ajax, {
245 data : selectedOpts.ajax.data || {},
246 error : function(XMLHttpRequest, textStatus, errorThrown) {
247 if ( XMLHttpRequest.status > 0 ) {
251 success : function(data, textStatus, XMLHttpRequest) {
252 var o = typeof XMLHttpRequest == 'object' ? XMLHttpRequest : ajaxLoader;
253 if (o.status == 200) {
254 if ( typeof selectedOpts.ajax.win == 'function' ) {
255 ret = selectedOpts.ajax.win(href, data, textStatus, XMLHttpRequest);
260 } else if (typeof ret == 'string' || typeof ret == 'object') {
279 _process_inline = function() {
281 w = selectedOpts.width,
282 h = selectedOpts.height;
284 if (w.toString().indexOf('%') > -1) {
285 w = parseInt( ($(window).width() - (selectedOpts.margin * 2)) * parseFloat(w) / 100, 10) + 'px';
288 w = w == 'auto' ? 'auto' : w + 'px';
291 if (h.toString().indexOf('%') > -1) {
292 h = parseInt( ($(window).height() - (selectedOpts.margin * 2)) * parseFloat(h) / 100, 10) + 'px';
295 h = h == 'auto' ? 'auto' : h + 'px';
298 tmp.wrapInner('<div style="width:' + w + ';height:' + h + ';overflow: ' + (selectedOpts.scrolling == 'auto' ? 'auto' : (selectedOpts.scrolling == 'yes' ? 'scroll' : 'hidden')) + ';position:relative;"></div>');
300 selectedOpts.width = tmp.width();
301 selectedOpts.height = tmp.height();
306 _process_image = function() {
307 selectedOpts.width = imgPreloader.width;
308 selectedOpts.height = imgPreloader.height;
311 'id' : 'fancybox-img',
312 'src' : imgPreloader.src,
313 'alt' : selectedOpts.title
324 if (wrap.is(":visible") && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
325 $.event.trigger('fancybox-cancel');
333 $(content.add( overlay )).unbind();
335 $(window).unbind("resize.fb scroll.fb");
336 $(document).unbind('keydown.fb');
338 if (wrap.is(":visible") && currentOpts.titlePosition !== 'outside') {
339 wrap.css('height', wrap.height());
342 currentArray = selectedArray;
343 currentIndex = selectedIndex;
344 currentOpts = selectedOpts;
346 if (currentOpts.overlayShow) {
348 'background-color' : currentOpts.overlayColor,
349 'opacity' : currentOpts.overlayOpacity,
350 'cursor' : currentOpts.hideOnOverlayClick ? 'pointer' : 'auto',
351 'height' : $(document).height()
354 if (!overlay.is(':visible')) {
356 $('select:not(#fancybox-tmp select)').filter(function() {
357 return this.style.visibility !== 'hidden';
358 }).css({'visibility' : 'hidden'}).one('fancybox-cleanup', function() {
359 this.style.visibility = 'inherit';
369 final_pos = _get_zoom_to();
373 if (wrap.is(":visible")) {
374 $( close.add( nav_left ).add( nav_right ) ).hide();
376 pos = wrap.position(),
381 width : wrap.width(),
382 height : wrap.height()
385 equal = (start_pos.width == final_pos.width && start_pos.height == final_pos.height);
387 content.fadeTo(currentOpts.changeFade, 0.3, function() {
388 var finish_resizing = function() {
389 content.html( tmp.contents() ).fadeTo(currentOpts.changeFade, 1, _finish);
392 $.event.trigger('fancybox-change');
396 .removeAttr('filter')
398 'border-width' : currentOpts.padding,
399 'width' : final_pos.width - currentOpts.padding * 2,
400 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
409 $(fx).animate({prop: 1}, {
410 duration : currentOpts.changeSpeed,
411 easing : currentOpts.easingChange,
413 complete : finish_resizing
421 wrap.removeAttr("style");
423 content.css('border-width', currentOpts.padding);
425 if (currentOpts.transitionIn == 'elastic') {
426 start_pos = _get_zoom_from();
428 content.html( tmp.contents() );
432 if (currentOpts.opacity) {
433 final_pos.opacity = 0;
438 $(fx).animate({prop: 1}, {
439 duration : currentOpts.speedIn,
440 easing : currentOpts.easingIn,
448 if (currentOpts.titlePosition == 'inside' && titleHeight > 0) {
454 'width' : final_pos.width - currentOpts.padding * 2,
455 'height' : selectedOpts.autoDimensions ? 'auto' : final_pos.height - titleHeight - currentOpts.padding * 2
457 .html( tmp.contents() );
461 .fadeIn( currentOpts.transitionIn == 'none' ? 0 : currentOpts.speedIn, _finish );
464 _format_title = function(title) {
465 if (title && title.length) {
466 if (currentOpts.titlePosition == 'float') {
467 return '<table id="fancybox-title-float-wrap" cellpadding="0" cellspacing="0"><tr><td id="fancybox-title-float-left"></td><td id="fancybox-title-float-main">' + title + '</td><td id="fancybox-title-float-right"></td></tr></table>';
470 return '<div id="fancybox-title-' + currentOpts.titlePosition + '">' + title + '</div>';
476 _process_title = function() {
477 titleStr = currentOpts.title || '';
485 if (currentOpts.titleShow === false) {
490 titleStr = $.isFunction(currentOpts.titleFormat) ? currentOpts.titleFormat(titleStr, currentArray, currentIndex, currentOpts) : _format_title(titleStr);
492 if (!titleStr || titleStr === '') {
498 .addClass('fancybox-title-' + currentOpts.titlePosition)
503 switch (currentOpts.titlePosition) {
507 'width' : final_pos.width - (currentOpts.padding * 2),
508 'marginLeft' : currentOpts.padding,
509 'marginRight' : currentOpts.padding
512 titleHeight = title.outerHeight(true);
514 title.appendTo( outer );
516 final_pos.height += titleHeight;
522 'marginLeft' : currentOpts.padding,
523 'width' : final_pos.width - (currentOpts.padding * 2),
524 'bottom' : currentOpts.padding
531 .css('left', parseInt((title.width() - final_pos.width - 40)/ 2, 10) * -1)
538 'width' : final_pos.width - (currentOpts.padding * 2),
539 'paddingLeft' : currentOpts.padding,
540 'paddingRight' : currentOpts.padding
549 _set_navigation = function() {
550 if (currentOpts.enableEscapeButton || currentOpts.enableKeyboardNav) {
551 $(document).bind('keydown.fb', function(e) {
552 if (e.keyCode == 27 && currentOpts.enableEscapeButton) {
556 } else if ((e.keyCode == 37 || e.keyCode == 39) && currentOpts.enableKeyboardNav && e.target.tagName !== 'INPUT' && e.target.tagName !== 'TEXTAREA' && e.target.tagName !== 'SELECT') {
558 $.fancybox[ e.keyCode == 37 ? 'prev' : 'next']();
563 if (!currentOpts.showNavArrows) {
569 if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex !== 0) {
573 if ((currentOpts.cyclic && currentArray.length > 1) || currentIndex != (currentArray.length -1)) {
578 _finish = function () {
579 if (!$.support.opacity) {
580 content.get(0).style.removeAttribute('filter');
581 wrap.get(0).style.removeAttribute('filter');
584 if (selectedOpts.autoDimensions) {
585 content.css('height', 'auto');
588 wrap.css('height', 'auto');
590 if (titleStr && titleStr.length) {
594 if (currentOpts.showCloseButton) {
600 if (currentOpts.hideOnContentClick) {
601 content.bind('click', $.fancybox.close);
604 if (currentOpts.hideOnOverlayClick) {
605 overlay.bind('click', $.fancybox.close);
608 $(window).bind("resize.fb", $.fancybox.resize);
610 if (currentOpts.centerOnScroll) {
611 $(window).bind("scroll.fb", $.fancybox.center);
614 if (currentOpts.type == 'iframe') {
615 $('<iframe id="fancybox-frame" name="fancybox-frame' + new Date().getTime() + '" frameborder="0" hspace="0" ' + ($.browser.msie ? 'allowtransparency="true""' : '') + ' scrolling="' + selectedOpts.scrolling + '" src="' + currentOpts.href + '"></iframe>').appendTo(content);
624 currentOpts.onComplete(currentArray, currentIndex, currentOpts);
629 _preload_images = function() {
633 if ((currentArray.length -1) > currentIndex) {
634 href = currentArray[ currentIndex + 1 ].href;
636 if (typeof href !== 'undefined' && href.match(imgRegExp)) {
637 objNext = new Image();
642 if (currentIndex > 0) {
643 href = currentArray[ currentIndex - 1 ].href;
645 if (typeof href !== 'undefined' && href.match(imgRegExp)) {
646 objNext = new Image();
652 _draw = function(pos) {
654 width : parseInt(start_pos.width + (final_pos.width - start_pos.width) * pos, 10),
655 height : parseInt(start_pos.height + (final_pos.height - start_pos.height) * pos, 10),
657 top : parseInt(start_pos.top + (final_pos.top - start_pos.top) * pos, 10),
658 left : parseInt(start_pos.left + (final_pos.left - start_pos.left) * pos, 10)
661 if (typeof final_pos.opacity !== 'undefined') {
662 dim.opacity = pos < 0.5 ? 0.5 : pos;
668 'width' : dim.width - currentOpts.padding * 2,
669 'height' : dim.height - (titleHeight * pos) - currentOpts.padding * 2
673 _get_viewport = function() {
675 $(window).width() - (currentOpts.margin * 2),
676 $(window).height() - (currentOpts.margin * 2),
677 $(document).scrollLeft() + currentOpts.margin,
678 $(document).scrollTop() + currentOpts.margin
682 _get_zoom_to = function () {
683 var view = _get_viewport(),
685 resize = currentOpts.autoScale,
686 double_padding = currentOpts.padding * 2,
689 if (currentOpts.width.toString().indexOf('%') > -1) {
690 to.width = parseInt((view[0] * parseFloat(currentOpts.width)) / 100, 10);
692 to.width = currentOpts.width + double_padding;
695 if (currentOpts.height.toString().indexOf('%') > -1) {
696 to.height = parseInt((view[1] * parseFloat(currentOpts.height)) / 100, 10);
698 to.height = currentOpts.height + double_padding;
701 if (resize && (to.width > view[0] || to.height > view[1])) {
702 if (selectedOpts.type == 'image' || selectedOpts.type == 'swf') {
703 ratio = (currentOpts.width ) / (currentOpts.height );
705 if ((to.width ) > view[0]) {
707 to.height = parseInt(((to.width - double_padding) / ratio) + double_padding, 10);
710 if ((to.height) > view[1]) {
712 to.width = parseInt(((to.height - double_padding) * ratio) + double_padding, 10);
716 to.width = Math.min(to.width, view[0]);
717 to.height = Math.min(to.height, view[1]);
721 to.top = parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - to.height - 40) * 0.5)), 10);
722 to.left = parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - to.width - 40) * 0.5)), 10);
727 _get_obj_pos = function(obj) {
728 var pos = obj.offset();
730 pos.top += parseInt( obj.css('paddingTop'), 10 ) || 0;
731 pos.left += parseInt( obj.css('paddingLeft'), 10 ) || 0;
733 pos.top += parseInt( obj.css('border-top-width'), 10 ) || 0;
734 pos.left += parseInt( obj.css('border-left-width'), 10 ) || 0;
736 pos.width = obj.width();
737 pos.height = obj.height();
742 _get_zoom_from = function() {
743 var orig = selectedOpts.orig ? $(selectedOpts.orig) : false,
748 if (orig && orig.length) {
749 pos = _get_obj_pos(orig);
752 width : pos.width + (currentOpts.padding * 2),
753 height : pos.height + (currentOpts.padding * 2),
754 top : pos.top - currentOpts.padding - 20,
755 left : pos.left - currentOpts.padding - 20
759 view = _get_viewport();
762 width : currentOpts.padding * 2,
763 height : currentOpts.padding * 2,
764 top : parseInt(view[3] + view[1] * 0.5, 10),
765 left : parseInt(view[2] + view[0] * 0.5, 10)
772 _animate_loading = function() {
773 if (!loading.is(':visible')){
774 clearInterval(loadingTimer);
778 $('div', loading).css('top', (loadingFrame * -40) + 'px');
780 loadingFrame = (loadingFrame + 1) % 12;
787 $.fn.fancybox = function(options) {
788 if (!$(this).length) {
793 .data('fancybox', $.extend({}, options, ($.metadata ? $(this).metadata() : {})))
795 .bind('click.fb', function(e) {
809 var rel = $(this).attr('rel') || '';
811 if (!rel || rel == '' || rel === 'nofollow') {
812 selectedArray.push(this);
815 selectedArray = $("a[rel=" + rel + "], area[rel=" + rel + "]");
816 selectedIndex = selectedArray.index( this );
827 $.fancybox = function(obj) {
835 opts = typeof arguments[1] !== 'undefined' ? arguments[1] : {};
838 selectedIndex = parseInt(opts.index, 10) || 0;
840 if ($.isArray(obj)) {
841 for (var i = 0, j = obj.length; i < j; i++) {
842 if (typeof obj[i] == 'object') {
843 $(obj[i]).data('fancybox', $.extend({}, opts, obj[i]));
845 obj[i] = $({}).data('fancybox', $.extend({content : obj[i]}, opts));
849 selectedArray = jQuery.merge(selectedArray, obj);
852 if (typeof obj == 'object') {
853 $(obj).data('fancybox', $.extend({}, opts, obj));
855 obj = $({}).data('fancybox', $.extend({content : obj}, opts));
858 selectedArray.push(obj);
861 if (selectedIndex > selectedArray.length || selectedIndex < 0) {
868 $.fancybox.showActivity = function() {
869 clearInterval(loadingTimer);
872 loadingTimer = setInterval(_animate_loading, 66);
875 $.fancybox.hideActivity = function() {
879 $.fancybox.next = function() {
880 return $.fancybox.pos( currentIndex + 1);
883 $.fancybox.prev = function() {
884 return $.fancybox.pos( currentIndex - 1);
887 $.fancybox.pos = function(pos) {
894 selectedArray = currentArray;
896 if (pos > -1 && pos < currentArray.length) {
900 } else if (currentOpts.cyclic && currentArray.length > 1) {
901 selectedIndex = pos >= currentArray.length ? 0 : currentArray.length - 1;
908 $.fancybox.cancel = function() {
915 $.event.trigger('fancybox-cancel');
919 selectedOpts.onCancel(selectedArray, selectedIndex, selectedOpts);
924 // Note: within an iframe use - parent.$.fancybox.close();
925 $.fancybox.close = function() {
926 if (busy || wrap.is(':hidden')) {
932 if (currentOpts && false === currentOpts.onCleanup(currentArray, currentIndex, currentOpts)) {
939 $(close.add( nav_left ).add( nav_right )).hide();
941 $(content.add( overlay )).unbind();
943 $(window).unbind("resize.fb scroll.fb");
944 $(document).unbind('keydown.fb');
946 content.find('iframe').attr('src', isIE6 && /^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank');
948 if (currentOpts.titlePosition !== 'inside') {
954 function _cleanup() {
955 overlay.fadeOut('fast');
957 title.empty().hide();
960 $.event.trigger('fancybox-cleanup');
964 currentOpts.onClosed(currentArray, currentIndex, currentOpts);
966 currentArray = selectedOpts = [];
967 currentIndex = selectedIndex = 0;
968 currentOpts = selectedOpts = {};
973 if (currentOpts.transitionOut == 'elastic') {
974 start_pos = _get_zoom_from();
976 var pos = wrap.position();
981 width : wrap.width(),
982 height : wrap.height()
985 if (currentOpts.opacity) {
986 final_pos.opacity = 1;
989 title.empty().hide();
993 $(fx).animate({ prop: 0 }, {
994 duration : currentOpts.speedOut,
995 easing : currentOpts.easingOut,
1001 wrap.fadeOut( currentOpts.transitionOut == 'none' ? 0 : currentOpts.speedOut, _cleanup);
1005 $.fancybox.resize = function() {
1006 if (overlay.is(':visible')) {
1007 overlay.css('height', $(document).height());
1010 $.fancybox.center(true);
1013 $.fancybox.center = function() {
1020 align = arguments[0] === true ? 1 : 0;
1021 view = _get_viewport();
1023 if (!align && (wrap.width() > view[0] || wrap.height() > view[1])) {
1030 'top' : parseInt(Math.max(view[3] - 20, view[3] + ((view[1] - content.height() - 40) * 0.5) - currentOpts.padding)),
1031 'left' : parseInt(Math.max(view[2] - 20, view[2] + ((view[0] - content.width() - 40) * 0.5) - currentOpts.padding))
1032 }, typeof arguments[0] == 'number' ? arguments[0] : 200);
1035 $.fancybox.init = function() {
1036 if ($("#fancybox-wrap").length) {
1041 tmp = $('<div id="fancybox-tmp"></div>'),
1042 loading = $('<div id="fancybox-loading"><div></div></div>'),
1043 overlay = $('<div id="fancybox-overlay"></div>'),
1044 wrap = $('<div id="fancybox-wrap"></div>')
1047 outer = $('<div id="fancybox-outer"></div>')
1048 .append('<div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>')
1052 content = $('<div id="fancybox-content"></div>'),
1053 close = $('<a id="fancybox-close"></a>'),
1054 title = $('<div id="fancybox-title"></div>'),
1056 nav_left = $('<a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a>'),
1057 nav_right = $('<a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a>')
1060 close.click($.fancybox.close);
1061 loading.click($.fancybox.cancel);
1063 nav_left.click(function(e) {
1068 nav_right.click(function(e) {
1073 if ($.fn.mousewheel) {
1074 wrap.bind('mousewheel.fb', function(e, delta) {
1078 } else if ($(e.target).get(0).clientHeight == 0 || $(e.target).get(0).scrollHeight === $(e.target).get(0).clientHeight) {
1080 $.fancybox[ delta > 0 ? 'prev' : 'next']();
1085 if (!$.support.opacity) {
1086 wrap.addClass('fancybox-ie');
1090 loading.addClass('fancybox-ie6');
1091 wrap.addClass('fancybox-ie6');
1093 $('<iframe id="fancybox-hide-sel-frame" src="' + (/^https/i.test(window.location.href || '') ? 'javascript:void(false)' : 'about:blank' ) + '" scrolling="no" border="0" frameborder="0" tabindex="-1"></iframe>').prependTo(outer);
1097 $.fn.fancybox.defaults = {
1103 scrolling : 'auto', // 'auto', 'yes' or 'no'
1109 autoDimensions : true,
1110 centerOnScroll : false,
1113 swf : { wmode: 'transparent' },
1115 hideOnOverlayClick : true,
1116 hideOnContentClick : false,
1119 overlayOpacity : 0.7,
1120 overlayColor : '#777',
1123 titlePosition : 'float', // 'float', 'outside', 'inside' or 'over'
1125 titleFromAlt : false,
1127 transitionIn : 'fade', // 'elastic', 'fade' or 'none'
1128 transitionOut : 'fade', // 'elastic', 'fade' or 'none'
1134 changeFade : 'fast',
1137 easingOut : 'swing',
1139 showCloseButton : true,
1140 showNavArrows : true,
1141 enableEscapeButton : true,
1142 enableKeyboardNav : true,
1144 onStart : function(){},
1145 onCancel : function(){},
1146 onComplete : function(){},
1147 onCleanup : function(){},
1148 onClosed : function(){},
1149 onError : function(){}
1152 $(document).ready(function() {